diff options
author | Duncan Coutts <duncan.coutts@worc.ox.ac.uk> | 2006-01-17 19:29:55 +0000 |
---|---|---|
committer | Duncan Coutts <duncan.coutts@worc.ox.ac.uk> | 2006-01-17 19:29:55 +0000 |
commit | aa36c783045c5116b773ef5a4e843d916dbe6e3c (patch) | |
tree | 9c7fc7f8e9015cf78dc691f9a943ead468a6b20c /src/Main.hs | |
parent | 766cecdda0a834e2a50a6aaa36518ea6b4ac360c (diff) |
Add a --wiki=URL flag to add a per-module link to a correspondng wiki page.
So each html page gets an extra link (placed next to the source code and
contents links) to a corresponding wiki page. The idea is to let readers
contribute their own notes, examples etc to the documentation.
Also slightly tidy up the code for the --source option.
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs index bed74040..2d6408f0 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -79,6 +79,7 @@ data Flag | Flag_Prologue FilePath | Flag_ReadInterface FilePath | Flag_SourceURL String + | Flag_WikiURL String | Flag_Help | Flag_Verbose | Flag_Version @@ -110,6 +111,8 @@ options = "produce index and table of contents in mshelp, mshelp2 or devhelp format (with -h)", Option ['s'] ["source"] (ReqArg Flag_SourceURL "URL") "base URL for links to source code", + Option [] ["wiki"] (ReqArg Flag_WikiURL "URL") + "base URL for links to a wiki", Option ['c'] ["css"] (ReqArg Flag_CSS "FILE") "the CSS file to use for HTML output", Option ['p'] ["prologue"] (ReqArg Flag_Prologue "FILE") @@ -161,7 +164,11 @@ run flags files = do [] -> Nothing (t:_) -> Just t - source_url = case [str | Flag_SourceURL str <- flags] of + maybe_source_url = case [str | Flag_SourceURL str <- flags] of + [] -> Nothing + (t:_) -> Just t + + maybe_wiki_url = case [str | Flag_WikiURL str <- flags] of [] -> Nothing (t:_) -> Just t @@ -292,8 +299,9 @@ run flags files = do | i <- these_ifaces ]) when (Flag_Html `elem` flags) $ do - ppHtml title package source_url these_ifaces odir + ppHtml title package these_ifaces odir prologue maybe_html_help_format + maybe_source_url maybe_wiki_url maybe_contents_url maybe_index_url copyHtmlBits odir libdir css_file |