Comments (2)
Thanks a lot for the suggestion. :)
from haddock.
In GHC9 a workaround with TH is available, but it is limited to source functions defined in the same package, at least I have such experience with GHC-9.2.5 and cabal haddock --haddock-all
:
appendHaddocksFrom ::
Name -> -- ^ sourceName
Name -> -- ^ targetName
Q [Dec]
appendHaddocksFrom sourceName targetName = do
addModFinalizer $ do
srcDocsM <- getDoc $ DeclDoc sourceName
case srcDocsM of
Nothing -> do
runIO (putStrLn $ "no src docs (" <> show sourceName <> ")")
pure ()
Just sd -> do
targetDocs <- fromMaybe "" <$> getDoc target
runIO (putStrLn $ "target docs: (" <> show target <> "):\n" <> targetDocs)
putDoc target $ targetDocs <>
"\n\n### __Following snippet is included from__ " <>
nameRef sourceName <> "\n\n" <> sd
pure []
where
target = DeclDoc targetName
module SupModule where
-- | 'foo' has haddocks in public domain
foo :: Int
foo = 3
module Module where
import SupModule
bar :: Int
bar = foo
$(appendHaddocksFrom 'foo 'bar)
from haddock.
Related Issues (20)
- Add a Haddock option for MagicHash
- Re-export behavior
- Version bounds for haddock-api-2.26.0 seem wrong
- Finish the hi-haddock story HOT 4
- Tooltips use unrelated type synonyms HOT 1
- Unrendered since annotations
- Haddock crash when table contains "unicode" symbols HOT 1
- non-local javascript
- Feature proposal: Mermaid diagrams HOT 1
- haddock: internal error: ..Cabal.../share/doc/html/doc-index.json: openBinaryFile: does not exist HOT 7
- Support GHC 9.6.1 HOT 3
- Linearity hidden in multi-line type signatures HOT 1
- hlint CI chokes on `MIN_VERSION_ghc(9,5,0)` (?) HOT 2
- Can't un-collapse collapsible example on chunk of documentation
- Unexpected result when using closing backtick for hyperlinked identifiers that end with single quote HOT 2
- How to tell from Haddocks whether a data type is a re-export? HOT 3
- Can't install haddock through cabal HOT 4
- Pretty Printing of Types in Declarations
- Haddock panic when combined with "type data" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haddock.