aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Xhtml/Layout.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Layout.hs')
-rw-r--r--src/Haddock/Backends/Xhtml/Layout.hs36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs
index ac6f5021..86c722b7 100644
--- a/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/src/Haddock/Backends/Xhtml/Layout.hs
@@ -11,6 +11,14 @@
-- Portability : portable
-----------------------------------------------------------------------------
module Haddock.Backends.Xhtml.Layout (
+ divPackageHeader, divModuleHeader, divFooter,
+ divTableOfContents, divDescription, divSynposis, divInterface,
+
+ sectionName,
+
+ shortDeclList,
+ divTopDecl,
+
topDeclElem, declElem,
instHdr, atHdr, methHdr, constrHdr,
@@ -29,10 +37,36 @@ import Text.XHtml hiding ( name, title, p, quote )
import FastString ( unpackFS )
import GHC
+-- Sections of the document
+
+divPackageHeader, divModuleHeader, divFooter :: Html -> Html
+divPackageHeader = thediv ! [identifier "package-header"]
+divModuleHeader = thediv ! [identifier "module-header"]
+divFooter = thediv ! [identifier "footer"]
+
+divTableOfContents, divDescription, divSynposis, divInterface :: Html -> Html
+divTableOfContents = thediv ! [identifier "table-of-contents"]
+divDescription = thediv ! [identifier "description"]
+divSynposis = thediv ! [identifier "synopsis"]
+divInterface = thediv ! [identifier "interface"]
+
+-- | The name of a section, used directly after opening a section
+sectionName :: Html -> Html
+sectionName = paragraph ! [theclass "caption"]
+
+
+-- | Declaration containers
+
+shortDeclList :: [Html] -> Html
+shortDeclList items = ulist << map (li ! [theclass "src short"] <<) items
+
+divTopDecl :: Html -> Html
+divTopDecl = thediv ! [theclass "top"]
+
-- a box for displaying code
declElem :: Html -> Html
-declElem = paragraph ! [theclass "decl"]
+declElem = paragraph ! [theclass "src"]
-- a box for top level documented names
-- it adds a source and wiki link at the right hand side of the box