From edd9f2295507bce2247108a4d5a0d991f15fd250 Mon Sep 17 00:00:00 2001 From: Duncan Coutts Date: Sun, 22 Jan 2006 00:02:00 +0000 Subject: Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. --- src/Main.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 1f76fe47..491eeccf 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -236,12 +236,14 @@ run flags files = do when (Flag_GenContents `elem` flags) $ do ppHtmlContents odir title package maybe_html_help_format - maybe_index_url maybe_wiki_url visible_read_ifaces prologue + maybe_index_url maybe_source_url maybe_wiki_url + visible_read_ifaces prologue copyHtmlBits odir libdir css_file when (Flag_GenIndex `elem` flags) $ do ppHtmlIndex odir title package maybe_html_help_format - maybe_contents_url maybe_wiki_url visible_read_ifaces + maybe_contents_url maybe_source_url maybe_wiki_url + visible_read_ifaces copyHtmlBits odir libdir css_file when (Flag_GenContents `elem` flags && Flag_GenIndex `elem` flags) $ do -- cgit v1.2.3