From cc5e79229d4da32eb512d3a6e307e86db11133c4 Mon Sep 17 00:00:00 2001 From: Conal Elliott Date: Wed, 14 Feb 2007 21:54:00 +0000 Subject: added substitution %{FILE///c} --- doc/haddock.xml | 20 ++++++++++++++------ src/Haddock/Backends/Html.hs | 3 +++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 16b8b05d..c36b707b 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -532,6 +532,13 @@ replace it with a character c use %{MODULE/./c}. + Similarly, for the %{FILE} substitution + you may want to replace the '/' character in + the file names with some other character (especially for links + to colourised entity source code with a shared css file). To replace + it with a character c use + %{FILE///c}/ + One example of a tool that can generate syntax-highlighted HTML from your source code, complete with anchors suitable for use from haddock, is @@ -591,13 +598,14 @@ haddock --comments-base=url --comments-module=url/%M - If your Wiki system doesn't like the '.' - character in Haskell module names, you can replace it with a - different character. For example to replace the - '.' characters with '_' use - haddock --comments-base=url + If your Wiki system doesn't like the '.' character + in Haskell module names, you can replace it with a different character. For + example to replace the '.' characters with + '_' use haddock + --comments-base=url --comments-module=url/%{MODULE/./_} - + Similarly, you can replace the '/' in a file name (may + be useful for entity comments, but probably not.) diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs index 8c73e0ff..52a80096 100644 --- a/src/Haddock/Backends/Html.hs +++ b/src/Haddock/Backends/Html.hs @@ -191,6 +191,9 @@ spliceURL maybe_file maybe_mod maybe_name url = run url run ('%':'{':'M':'O':'D':'U':'L':'E':'/':'.':'/':c:'}':rest) = map (\x -> if x == '.' then c else x) mod ++ run rest + run ('%':'{':'F':'I':'L':'E':'/':'/':'/':c:'}':rest) = + map (\x -> if x == '/' then c else x) file ++ run rest + run (c:rest) = c : run rest wikiButton :: WikiURLs -> Maybe Module -> HtmlTable -- cgit v1.2.3