diff options
Diffstat (limited to 'src/Haddock/Backends/Xhtml/DocMarkup.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/DocMarkup.hs | 19 |
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 |