diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-07-14 07:04:10 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-07-14 07:04:10 +0000 |
commit | cd869b6a41463f6fd0c979bafe09ce06cbc05ee2 (patch) | |
tree | fd640a685c7f2e89fbec060e22208fc7f16fc807 | |
parent | 60962ea3ab84060880426a9f42d88e53a70499a0 (diff) |
made subDecl tables looks just so
-rw-r--r-- | html/xhaddock.css | 14 | ||||
-rw-r--r-- | src/Haddock/Backends/Xhtml/Layout.hs | 20 |
2 files changed, 27 insertions, 7 deletions
diff --git a/html/xhaddock.css b/html/xhaddock.css index fc305af3..ae2d2121 100644 --- a/html/xhaddock.css +++ b/html/xhaddock.css @@ -204,9 +204,6 @@ div.top h5 { margin-left: 10px; } -div.top table, div.subdecl { - margin-left: 20px; -} .src { padding: 3px; @@ -253,6 +250,17 @@ div.subs { margin-top: 2px; } +.subs table { + margin-left: 10px; + border-spacing: 1px 1px; + margin-top: 4px; + margin-bottom: 4px; +} + +.subs table table { + margin-left: 0; +} + .fields .caption { display: none; } diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index 80dd5ec8..3c695042 100644 --- a/src/Haddock/Backends/Xhtml/Layout.hs +++ b/src/Haddock/Backends/Xhtml/Layout.hs @@ -80,17 +80,29 @@ subDlist :: [SubDecl] -> Maybe Html subDlist [] = Nothing subDlist decls = Just $ dlist << map subEntry decls where - subEntry (decl, mdoc, subs) = Just $ + subEntry (decl, mdoc, subs) = dterm ! [theclass "src"] << decl - +++ ddef << (fmap docToHtml mdoc `with` subs) + +++ + ddef << (fmap docToHtml mdoc `with` subs) + Nothing `with` [] = spaceHtml ma `with` bs = ma +++ bs +subTable :: [SubDecl] -> Maybe Html +subTable [] = Nothing +subTable decls = Just $ table << aboves (concatMap subRow decls) + where + subRow (decl, mdoc, subs) = + (td ! [theclass "src"] << decl + <-> + td << nonEmpty (fmap docToHtml mdoc)) + : map (cell . (td <<)) subs + subConstructors :: [(Html, Maybe (Doc DocName), [Html])] -> Html -subConstructors = divSubDecls "constructors" "Constructors" . subDlist +subConstructors = divSubDecls "constructors" "Constructors" . subTable subFields :: [(Html, Maybe (Doc DocName), [Html])] -> Html -subFields = divSubDecls "fields" "Fields" . subDlist +subFields = divSubDecls "fields" "Fields" . subTable -- a box for displaying code |