summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:10:17 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:10:17 +0000
commit9f126c15cf4d0f6c2ab14167e11336d4f5f8783e (patch)
tree416833a563f3be1b9e0bd72e1ec9006150e16943 /src/Text/Pandoc/Writers/HTML.hs
parentc602ed345959dbeb08533cd9c9c11f0604641c10 (diff)
Removed unneeded writer options; use template variables instead.
Removed writerIncludeAfter, writerIncludeBefore, writerTitlePrefix, writerHeader. Removed corresponding fields of Options structure in pandoc.hs. The options now set template variables (writerVariables) instead. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1684 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs115
1 files changed, 58 insertions, 57 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 2d1a143ec..4e2eb4e26 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -88,63 +88,64 @@ writeHtmlString opts =
-- | Convert Pandoc document to Html structure.
writeHtml :: WriterOptions -> Pandoc -> Html
-writeHtml opts (Pandoc (Meta tit authors date) blocks) =
- let titlePrefix = writerTitlePrefix opts
- (topTitle,st) = runState (inlineListToHtml opts tit) defaultWriterState
- topTitle'' = stripTags $ showHtmlFragment topTitle
- topTitle' = titlePrefix ++
- (if null topTitle'' || null titlePrefix
- then ""
- else " - ") ++ topTitle''
- metadata = thetitle << topTitle' +++
- meta ! [httpequiv "Content-Type",
- content "text/html; charset=UTF-8"] +++
- meta ! [name "generator", content "pandoc"] +++
- (toHtmlFromList $
- map (\a -> meta ! [name "author", content a]) authors) +++
- (if null date
- then noHtml
- else meta ! [name "date", content date])
- titleHeader = if writerStandalone opts && not (null tit) &&
- not (writerS5 opts)
- then h1 ! [theclass "title"] $ topTitle
- else noHtml
- sects = hierarchicalize blocks
- toc = if writerTableOfContents opts
- then evalState (tableOfContents opts sects) st
- else noHtml
- (blocks', st') = runState
- (mapM (elementToHtml opts) sects >>= return . toHtmlFromList)
- st
- cssLines = stCSS st'
- css = if S.null cssLines
- then noHtml
- else style ! [thetype "text/css"] $ primHtml $
- '\n':(unlines $ S.toList cssLines)
- math = if stMath st'
- then case writerHTMLMathMethod opts of
- LaTeXMathML Nothing ->
- primHtml latexMathMLScript
- LaTeXMathML (Just url) ->
- script !
- [src url, thetype "text/javascript"] $
- noHtml
- JsMath (Just url) ->
- script !
- [src url, thetype "text/javascript"] $
- noHtml
- _ -> noHtml
- else noHtml
- head' = header $ metadata +++ math +++ css +++
- primHtml (renderTemplate [] $ writerHeader opts)
- notes = reverse (stNotes st')
- before = primHtml $ writerIncludeBefore opts
- after = primHtml $ writerIncludeAfter opts
- thebody = before +++ titleHeader +++ toc +++ blocks' +++
- footnoteSection notes +++ after
- in if writerStandalone opts
- then head' +++ body thebody
- else thebody
+writeHtml opts (Pandoc (Meta tit authors date) blocks) =
+ noHtml -- TODO
+-- let titlePrefix = writerTitlePrefix opts
+-- (topTitle,st) = runState (inlineListToHtml opts tit) defaultWriterState
+-- topTitle'' = stripTags $ showHtmlFragment topTitle
+-- topTitle' = titlePrefix ++
+-- (if null topTitle'' || null titlePrefix
+-- then ""
+-- else " - ") ++ topTitle''
+-- metadata = thetitle << topTitle' +++
+-- meta ! [httpequiv "Content-Type",
+-- content "text/html; charset=UTF-8"] +++
+-- meta ! [name "generator", content "pandoc"] +++
+-- (toHtmlFromList $
+-- map (\a -> meta ! [name "author", content a]) authors) +++
+-- (if null date
+-- then noHtml
+-- else meta ! [name "date", content date])
+-- titleHeader = if writerStandalone opts && not (null tit) &&
+-- not (writerS5 opts)
+-- then h1 ! [theclass "title"] $ topTitle
+-- else noHtml
+-- sects = hierarchicalize blocks
+-- toc = if writerTableOfContents opts
+-- then evalState (tableOfContents opts sects) st
+-- else noHtml
+-- (blocks', st') = runState
+-- (mapM (elementToHtml opts) sects >>= return . toHtmlFromList)
+-- st
+-- cssLines = stCSS st'
+-- css = if S.null cssLines
+-- then noHtml
+-- else style ! [thetype "text/css"] $ primHtml $
+-- '\n':(unlines $ S.toList cssLines)
+-- math = if stMath st'
+-- then case writerHTMLMathMethod opts of
+-- LaTeXMathML Nothing ->
+-- primHtml latexMathMLScript
+-- LaTeXMathML (Just url) ->
+-- script !
+-- [src url, thetype "text/javascript"] $
+-- noHtml
+-- JsMath (Just url) ->
+-- script !
+-- [src url, thetype "text/javascript"] $
+-- noHtml
+-- _ -> noHtml
+-- else noHtml
+-- head' = header $ metadata +++ math +++ css +++
+-- primHtml (renderTemplate [] $ writerHeader opts)
+-- notes = reverse (stNotes st')
+-- before = primHtml $ writerIncludeBefore opts
+-- after = primHtml $ writerIncludeAfter opts
+-- thebody = before +++ titleHeader +++ toc +++ blocks' +++
+-- footnoteSection notes +++ after
+-- in if writerStandalone opts
+-- then head' +++ body thebody
+-- else thebody
-- | Like Text.XHtml's identifier, but adds the writerIdentifierPrefix
prefixedId :: WriterOptions -> String -> HtmlAttr