summaryrefslogtreecommitdiff
path: root/hadrian/src/Rules/Documentation.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-06-27 22:42:28 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-04 17:56:30 -0400
commitd002c6e04f0c0f26c3ee24661eb4cf5620f994ab (patch)
tree3b1a07e23ee41617c8e9fbe71f68271927853d6e /hadrian/src/Rules/Documentation.hs
parented793d7a5725689bf1f3c81ce3d7958ccaf60e7e (diff)
downloadhaskell-d002c6e04f0c0f26c3ee24661eb4cf5620f994ab.tar.gz
hadrian: Add --haddock-base-url option for specifying base-url when generating docs
The motiviation for this flag is to be able to produce documentation which is suitable for uploading for hackage, ie, the cross-package links work correctly. There are basically three values you want to set this to: * off - default, base_url = ../%pkg% which works for local browsing * on - no argument , base_url = https:://hackage.haskell.org/package/%pkg%/docs - for hackage docs upload * on - argument, for example, base_url = http://localhost:8080/package/%pkg%/docs for testing the documentation. The `%pkg%` string is a template variable which is replaced with the package identifier for the relevant package. This is one step towards fixing #21749
Diffstat (limited to 'hadrian/src/Rules/Documentation.hs')
-rw-r--r--hadrian/src/Rules/Documentation.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/hadrian/src/Rules/Documentation.hs b/hadrian/src/Rules/Documentation.hs
index 6898fd12e5..0e72c064c3 100644
--- a/hadrian/src/Rules/Documentation.hs
+++ b/hadrian/src/Rules/Documentation.hs
@@ -276,11 +276,11 @@ parsePkgDocTarget root = do
_ <- Parsec.string root *> Parsec.optional (Parsec.char '/')
_ <- Parsec.string (htmlRoot ++ "/")
_ <- Parsec.string "libraries/"
- pkgname <- Parsec.manyTill Parsec.anyChar (Parsec.char '/')
+ (pkgname, _) <- parsePkgId <* Parsec.char '/'
Parsec.choice
[ Parsec.try (Parsec.string "haddock-prologue.txt")
*> pure (HaddockPrologue pkgname)
- , Parsec.string (pkgname <.> "haddock")
+ , Parsec.string (pkgname <.> "haddock") -- Same as before
*> pure (DotHaddock pkgname)
]