From aa36c783045c5116b773ef5a4e843d916dbe6e3c Mon Sep 17 00:00:00 2001 From: Duncan Coutts Date: Tue, 17 Jan 2006 19:29:55 +0000 Subject: 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. --- src/Main.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Main.hs') 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 -- cgit v1.2.3