aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Xhtml/DocMarkup.hs
diff options
context:
space:
mode:
authorMark Lentczner <markl@glyphic.com>2010-07-18 06:12:22 +0000
committerMark Lentczner <markl@glyphic.com>2010-07-18 06:12:22 +0000
commita7aad74a978e2e1d313c23863c7a91983bbc4848 (patch)
treeb5f4859924a03f0c294131599ebdf4e82c3bf625 /src/Haddock/Backends/Xhtml/DocMarkup.hs
parentb143d90c46e01a3c2724003c4805110fab4b224e (diff)
add .doc class to documentation blocks
Diffstat (limited to 'src/Haddock/Backends/Xhtml/DocMarkup.hs')
-rw-r--r--src/Haddock/Backends/Xhtml/DocMarkup.hs19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/Haddock/Backends/Xhtml/DocMarkup.hs b/src/Haddock/Backends/Xhtml/DocMarkup.hs
index 0d4593a3..6563f914 100644
--- a/src/Haddock/Backends/Xhtml/DocMarkup.hs
+++ b/src/Haddock/Backends/Xhtml/DocMarkup.hs
@@ -11,9 +11,11 @@
-- Portability : portable
-----------------------------------------------------------------------------
module Haddock.Backends.Xhtml.DocMarkup (
- docToHtml, maybeDocToHtml,
+ docToHtml,
rdrDocToHtml,
- origDocToHtml
+ origDocToHtml,
+
+ docElement, docSection, maybeDocSection,
) where
import Haddock.Backends.Xhtml.Names
@@ -85,8 +87,17 @@ rdrDocToHtml :: Doc RdrName -> Html
rdrDocToHtml = markup fmt . cleanup
where fmt = parHtmlMarkup ppRdrName isRdrTc
-maybeDocToHtml :: Maybe (Doc DocName) -> Html
-maybeDocToHtml = maybe noHtml docToHtml
+
+
+docElement :: (ADDATTRS a) => a -> a
+docElement = (! [theclass "doc"])
+
+docSection :: Doc DocName -> Html
+docSection = (docElement thediv <<) . docToHtml
+
+maybeDocSection :: Maybe (Doc DocName) -> Html
+maybeDocSection = maybe noHtml docSection
+
cleanup :: Doc a -> Doc a
cleanup = markup fmtUnParagraphLists