You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stack haddock: How to correctly use --prologue? #6718
@ad-si, thanks for reporting. The problem seems to be this:
Stack builds with Cabal (the library) and will send Cabal a command like this:
[Cabal]
--builddir=.stack-work\dist\f24b2e15
haddock
--html
--hoogle
--html-location=../$pkg-$version/
--haddock-option=--hyperlinked-source
--haddock-option=--quickjump
--haddock-option=--prologue=my-prologue <<<< passing on the desired prologue file
For its part, Cabal then invokes Haddock with a command something like this (extracts only):
haddock.exe
--prologue=.stack-work\\dist\\f24b2e15\\doc\\html\\testHaddock\\had1135.txt <<<< Cabal's own prologue
--dump-interface=.stack-work\\dist\\f24b2e15\\doc\\html\\testHaddock\\testHaddock.haddock
--package-name=testHaddock
--package-version=0.1.0.0
--since-qual=external
...
--html
--hoogle
--title=testHaddock-0.1.0.0
...
src\\Lib.hs
--hyperlinked-source
--quickjump
--prologue=my-prologue <<<< passing on the desired prologue file
Cabal's own prologue seems to be the contents of the Cabal file's description field.
As Cabal has already snaffled the use of --prologue, it seems that you can't then specify your own.
The starting point for doing what you want to do is a new feature request for Cabal (the library). As Stack builds with the version of Cabal that ships with the specified version of GHC, if that feature is implemented by future Cabal, it won't come to Stack until that future Cabal ships with future GHC.
Activity
mpilgrem commentedon Apr 13, 2025
@ad-si, thanks for reporting. The problem seems to be this:
Stack builds with Cabal (the library) and will send Cabal a command like this:
For its part, Cabal then invokes Haddock with a command something like this (extracts only):
Cabal's own prologue seems to be the contents of the Cabal file's
descriptionfield.As Cabal has already snaffled the use of
--prologue, it seems that you can't then specify your own.The starting point for doing what you want to do is a new feature request for Cabal (the library). As Stack builds with the version of Cabal that ships with the specified version of GHC, if that feature is implemented by future Cabal, it won't come to Stack until that future Cabal ships with future GHC.
[-]How to correctly use --prologue[/-][+]`stack haddock`: How to correctly use `--prologue`?[/+]