From 6c589874c9fd4772880f758373852db83601dac6 Mon Sep 17 00:00:00 2001 From: David Waern Date: Wed, 21 Jul 2010 14:14:45 +0000 Subject: Style police in H.B.X.DocMarkup --- src/Haddock/Backends/Xhtml/DocMarkup.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Backends/Xhtml/DocMarkup.hs b/src/Haddock/Backends/Xhtml/DocMarkup.hs index 28f8c782..3ed36ed9 100644 --- a/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -18,6 +18,7 @@ module Haddock.Backends.Xhtml.DocMarkup ( docElement, docSection, maybeDocSection, ) where + import Haddock.Backends.Xhtml.Names import Haddock.Backends.Xhtml.Utils import Haddock.GhcUtils @@ -72,29 +73,31 @@ parHtmlMarkup ppId isTyCon = Markup { htmlExpression = (strong . thecode . toHtml $ expression ++ "\n") ! [theclass "userinput"] - -- If the doc is a single paragraph, don't surround it with

(this causes -- ugly extra whitespace with some browsers). FIXME: Does this still apply? docToHtml :: Doc DocName -> Html docToHtml = markup fmt . cleanup where fmt = parHtmlMarkup ppDocName (isTyConName . getName) + origDocToHtml :: Doc Name -> Html origDocToHtml = markup fmt . cleanup where fmt = parHtmlMarkup ppName isTyConName + rdrDocToHtml :: Doc RdrName -> Html rdrDocToHtml = markup fmt . cleanup where fmt = parHtmlMarkup ppRdrName isRdrTc - 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 -- cgit v1.2.3