From cd8536a66525fc96bc3f612913065ac9ee498873 Mon Sep 17 00:00:00 2001 From: Mark Lentczner Date: Sun, 18 Jul 2010 04:41:38 +0000 Subject: fixed alphabet on index page, and styling of it and packages in module lists --- src/Haddock/Backends/Xhtml.hs | 14 +++++++------- src/Haddock/Backends/Xhtml/Layout.hs | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/Haddock') diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index 6f12377e..bac24479 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -398,12 +398,11 @@ ppHtmlIndex odir doctitle maybe_package maybe_html_help_format headHtml (doctitle ++ " (" ++ indexName ch ++ ")") Nothing +++ bodyHtml doctitle Nothing maybe_source_url maybe_wiki_url - maybe_contents_url Nothing << - divIndex << - (sectionName << indexName ch +++ - (if showLetters then indexInitialLetterLinks else noHtml) +++ - (if null items then noHtml else buildIndex items) - ) + maybe_contents_url Nothing << [ + if showLetters then indexInitialLetterLinks else noHtml, + if null items then noHtml else + divIndex << [sectionName << indexName ch, buildIndex items] + ] indexName ch = "Index" ++ maybe "" (\c -> " - " ++ [c]) ch @@ -416,7 +415,8 @@ ppHtmlIndex odir doctitle maybe_package maybe_html_help_format -- unnecessarily hard to use. split_indices = length index > 150 - indexInitialLetterLinks = + indexInitialLetterLinks = + divAlphabet << unordList [ anchor ! [href (subIndexHtmlFile c)] << [c] | c <- initialChars , any ((==c) . toUpper . head . fst) index ] diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index c079ea42..081baeb6 100644 --- a/src/Haddock/Backends/Xhtml/Layout.hs +++ b/src/Haddock/Backends/Xhtml/Layout.hs @@ -14,7 +14,7 @@ module Haddock.Backends.Xhtml.Layout ( miniBody, divPackageHeader, divModuleHeader, divFooter, - divIndex, divModuleList, divTableOfContents, + divIndex, divAlphabet, divModuleList, divTableOfContents, divDescription, divSynposis, divInterface, sectionName, @@ -55,8 +55,9 @@ divPackageHeader = thediv ! [identifier "package-header"] divModuleHeader = thediv ! [identifier "module-header"] divFooter = thediv ! [identifier "footer"] -divIndex, divModuleList, divTableOfContents :: Html -> Html +divIndex, divAlphabet, divModuleList, divTableOfContents :: Html -> Html divIndex = thediv ! [identifier "index"] +divAlphabet = thediv ! [identifier "alphabet"] divModuleList = thediv ! [identifier "module-list"] divTableOfContents = thediv ! [identifier "table-of-contents"] -- cgit v1.2.3