aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lentczner <markl@glyphic.com>2010-07-18 04:41:38 +0000
committerMark Lentczner <markl@glyphic.com>2010-07-18 04:41:38 +0000
commitcd8536a66525fc96bc3f612913065ac9ee498873 (patch)
tree04ce036b6cc24f648f17cf7dffe1ef2c559395c9
parentd03e6a21c09b1d5257727895e33addfcc966e437 (diff)
fixed alphabet on index page, and styling of it and packages in module lists
-rw-r--r--html/shaddock.css22
-rw-r--r--html/thaddock.css26
-rw-r--r--html/xhaddock.css26
-rw-r--r--src/Haddock/Backends/Xhtml.hs14
-rw-r--r--src/Haddock/Backends/Xhtml/Layout.hs5
5 files changed, 77 insertions, 16 deletions
diff --git a/html/shaddock.css b/html/shaddock.css
index 4a46dd45..8ab3e57d 100644
--- a/html/shaddock.css
+++ b/html/shaddock.css
@@ -389,6 +389,24 @@ div.arguments {
background-color: #6060ff
}
+
+#alphabet ul {
+ list-style: none;
+ padding: 0;
+ margin: 0.5em 0 0;
+ font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif;
+ font-weight: bold;
+}
+
+#alphabet li {
+ display: inline;
+ margin: 0 0.25em;
+}
+
+#alphabet a {
+ text-decoration: none;
+}
+
#index td {
background-color: #f0f0f0;
padding-left: 1em;
@@ -419,4 +437,8 @@ body#mini {
#module-list ul {
list-style: none;
margin-top: 0.5em;
+}
+
+#module-list .package {
+ float: right;
} \ No newline at end of file
diff --git a/html/thaddock.css b/html/thaddock.css
index f09fc546..79b8767a 100644
--- a/html/thaddock.css
+++ b/html/thaddock.css
@@ -302,6 +302,22 @@ dd {
font-size: 80%;
}
+#alphabet ul {
+ list-style: none;
+ padding: 0;
+ margin: 0.5em 0 0;
+}
+
+#alphabet li {
+ display: inline;
+ margin: 0 0.25em;
+}
+
+#alphabet a {
+ text-decoration: none;
+ font-weight: bold;
+}
+
.module {
}
@@ -321,16 +337,18 @@ dd {
#module-list ul {
list-style: none;
- margin: 0 0 0 -10px;
padding: 0;
+ margin: 0;
}
#module-list li {
margin: 0;
border-top: 1px solid #eaeaea;
- padding-top: 2px;
- padding-bottom: 2px;
- padding-left: 10px;
+ padding: 2px 0 2px 1.4em;
+}
+
+#module-list li .package {
+ float: right;
}
#mini #interface .top,
diff --git a/html/xhaddock.css b/html/xhaddock.css
index 2fca2aed..695acc43 100644
--- a/html/xhaddock.css
+++ b/html/xhaddock.css
@@ -195,7 +195,8 @@ dl.info dd {
#description .caption,
#synopsis .caption,
-#module-list .caption {
+#module-list .caption,
+#index .caption {
padding-top: 15px;
font-weight: bold;
font-size: 150%
@@ -387,16 +388,35 @@ td.rdoc p {
#module-list ul {
list-style: none;
- margin-left: 10px;
padding-bottom: 15px;
+ padding-left: 2px;
+ margin: 0;
+}
+
+#module-list ul ul {
+ padding-bottom: 0;
+ padding-left: 20px;
}
+#module-list li .package {
+ float: right;
+}
#mini #module-list .caption {
display: none;
}
#index .caption {
- display: none;
+}
+
+#alphabet ul {
+ list-style: none;
+ padding: 0;
+ margin: 0.5em 0 0;
+}
+
+#alphabet li {
+ display: inline;
+ margin: 0 0.2em;
}
#index .src {
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"]