diff options
author | rrnewton <rrnewton@gmail.com> | 2010-10-24 03:19:28 +0000 |
---|---|---|
committer | rrnewton <rrnewton@gmail.com> | 2010-10-24 03:19:28 +0000 |
commit | 54de1813071ef9191299efa8fa71159767f5f090 (patch) | |
tree | acf014eac571d00c37fed34b49718ef3d1da4063 /src/Haddock/Backends | |
parent | 00064a3fd99b14e353d155650e3917d6b783bacc (diff) |
Change to index pages: include an 'All' option even when subdividing A-Z.
Diffstat (limited to 'src/Haddock/Backends')
-rw-r--r-- | src/Haddock/Backends/Xhtml.hs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index dc0bcaf2..e126eb9b 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -346,8 +346,11 @@ ppHtmlIndex odir doctitle _maybe_package themes createDirectoryIfMissing True odir - when split_indices $ + when split_indices $ do mapM_ (do_sub_index index) initialChars + -- Let's add a single large index as well for those who don't know exactly what they're looking for: + let mergedhtml = indexPage False Nothing index + writeFile (joinPath [odir, subIndexHtmlFile merged_name]) (renderToString mergedhtml) writeFile (joinPath [odir, indexHtmlFile]) (renderToString html) @@ -363,6 +366,7 @@ ppHtmlIndex odir doctitle _maybe_package themes ] indexName ch = "Index" ++ maybe "" (\c -> " - " ++ [c]) ch + merged_name = "All" buildIndex items = table << aboves (map indexElt items) @@ -375,9 +379,10 @@ ppHtmlIndex odir doctitle _maybe_package themes indexInitialLetterLinks = divAlphabet << - unordList [ anchor ! [href (subIndexHtmlFile c)] << [c] - | c <- initialChars - , any ((==c) . toUpper . head . fst) index ] + unordList (map (\str -> anchor ! [href (subIndexHtmlFile str)] << str) $ + [ [c] | c <- initialChars + , any ((==c) . toUpper . head . fst) index ] ++ + [merged_name]) -- todo: what about names/operators that start with Unicode -- characters? @@ -388,7 +393,7 @@ ppHtmlIndex odir doctitle _maybe_package themes do_sub_index this_ix c = unless (null index_part) $ - writeFile (joinPath [odir, subIndexHtmlFile c]) (renderToString html) + writeFile (joinPath [odir, subIndexHtmlFile [c]]) (renderToString html) where html = indexPage True (Just c) index_part index_part = [(n,stuff) | (n,stuff) <- this_ix, toUpper (head n) == c] |