aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Options.hs
diff options
context:
space:
mode:
authorDominic Steinitz <dominic@steinitz.org>2015-05-16 13:53:14 +0100
committerDominic Steinitz <dominic@steinitz.org>2015-12-21 08:07:11 +0000
commit3f50b955324bd4b42f88a421f0203bc46a3ccf64 (patch)
tree822a3c2e5779e87712552959b6b4987f1286e0ba /haddock-api/src/Haddock/Options.hs
parente01e4790402204af02ab0127ef5b633fb7748cd4 (diff)
Fix the documentation for haddock itself.
Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs
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 f84989ef..0449c829 100644
--- a/haddock-api/src/Haddock/Options.hs
+++ b/haddock-api/src/Haddock/Options.hs
@@ -26,6 +26,7 @@ module Haddock.Options (
wikiUrls,
optDumpInterfaceFile,
optLaTeXStyle,
+ optMathjax,
qualification,
verbosity,
ghcFlags,
@@ -69,6 +70,7 @@ data Flag
| Flag_LaTeXStyle String
| Flag_HyperlinkedSource
| Flag_SourceCss String
+ | Flag_Mathjax String
| Flag_Help
| Flag_Verbosity String
| Flag_Version
@@ -116,6 +118,7 @@ options backwardsCompat =
"output in HTML (XHTML 1.0)",
Option [] ["latex"] (NoArg Flag_LaTeX) "use experimental LaTeX rendering",
Option [] ["latex-style"] (ReqArg Flag_LaTeXStyle "FILE") "provide your own LaTeX style in FILE",
+ Option [] ["mathjax"] (ReqArg Flag_Mathjax "URL") "URL FOR mathjax",
Option ['U'] ["use-unicode"] (NoArg Flag_UseUnicode) "use Unicode in HTML output",
Option [] ["hoogle"] (NoArg Flag_Hoogle)
"output for Hoogle; you may want --package-name and --package-version too",
@@ -272,6 +275,10 @@ optLaTeXStyle :: [Flag] -> Maybe String
optLaTeXStyle flags = optLast [ str | Flag_LaTeXStyle str <- flags ]
+optMathjax :: [Flag] -> Maybe String
+optMathjax flags = optLast [ str | Flag_Mathjax str <- flags ]
+
+
qualification :: [Flag] -> Either String QualOption
qualification flags =
case map (map Char.toLower) [ str | Flag_Qualification str <- flags ] of