aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Options.hs
diff options
context:
space:
mode:
authorMarcin Szamotulski <profunctor@pm.me>2021-08-16 08:46:03 +0200
committerGitHub <noreply@github.com>2021-08-16 08:46:03 +0200
commit1b63771dee5a7fac0696505d0b335908bd12835d (patch)
tree6f50d00fdb9813d5c49c405cf3651e01f9932cdc /haddock-api/src/Haddock/Options.hs
parent32d280f30d73bb38769700be6ddaf26b9a69c77e (diff)
coot/multiple package (ghc-head) (#1419)
* FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".".
Diffstat (limited to 'haddock-api/src/Haddock/Options.hs')
-rw-r--r--haddock-api/src/Haddock/Options.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs
index 4d22505f..aa10b5b3 100644
--- a/haddock-api/src/Haddock/Options.hs
+++ b/haddock-api/src/Haddock/Options.hs
@@ -24,6 +24,7 @@ module Haddock.Options (
optSourceCssFile,
sourceUrls,
wikiUrls,
+ baseUrl,
optParCount,
optDumpInterfaceFile,
optShowInterfaceFile,
@@ -72,6 +73,7 @@ data Flag
| Flag_SourceEntityURL String
| Flag_SourceLEntityURL String
| Flag_WikiBaseURL String
+ | Flag_BaseURL String
| Flag_WikiModuleURL String
| Flag_WikiEntityURL String
| Flag_LaTeX
@@ -157,6 +159,8 @@ options backwardsCompat =
"URL for a source code link for each entity.\nUsed if name links are unavailable, eg. for TH splices.",
Option [] ["comments-base"] (ReqArg Flag_WikiBaseURL "URL")
"URL for a comments link on the contents\nand index pages",
+ Option [] ["base-url"] (ReqArg Flag_BaseURL "URL")
+ "Base URL for static assets (eg. css, javascript, json files etc.).\nWhen given statis assets will not be copied.",
Option [] ["comments-module"] (ReqArg Flag_WikiModuleURL "URL")
"URL for a comments link for each module\n(using the %{MODULE} var)",
Option [] ["comments-entity"] (ReqArg Flag_WikiEntityURL "URL")
@@ -301,6 +305,9 @@ wikiUrls flags =
,optLast [str | Flag_WikiEntityURL str <- flags])
+baseUrl :: [Flag] -> Maybe String
+baseUrl flags = optLast [str | Flag_BaseURL str <- flags]
+
optDumpInterfaceFile :: [Flag] -> Maybe FilePath
optDumpInterfaceFile flags = optLast [ str | Flag_DumpInterface str <- flags ]