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:14:35 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:14:35 +0000
commitd5907b3034994c98d9ea534574b36942717bb241 (patch)
tree3166e39abba1925f2e48e336d609f13b4dec2b3e /src/Text/Pandoc/Writers/HTML.hs
parent22dcf7afdd7ea4508d9b739a3b48138022d361e6 (diff)
Made renderTemplate polymorphic; added TemplateTarget class.
Now renderTemplate can return an Html, a Doc, a ByteString, or a String. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1712 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index a544ad781..cae2bb021 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -89,7 +89,7 @@ writeHtml opts d =
let (tit, auths, date, toc, body', newvars) = evalState (pandocToHtml opts d)
defaultWriterState
in if writerStandalone opts
- then primHtml $ inTemplate opts tit auths date toc body' newvars
+ then inTemplate opts tit auths date toc body' newvars
else body'
-- result is (title, authors, date, toc, body, new variables)
@@ -135,14 +135,15 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
[("math", renderHtmlFragment math) | stMath st]
return (tit, auths, date, toc, thebody, newvars)
-inTemplate :: WriterOptions
+inTemplate :: TemplateTarget a
+ => WriterOptions
-> Html
-> [Html]
-> Html
-> Html
-> Html
-> [(String,String)]
- -> String
+ -> a
inTemplate opts tit auths date toc body' newvars =
let renderedTit = showHtmlFragment tit
topTitle' = stripTags renderedTit