git.iko.soy/typeable/pandoc
on master help sign in
Context and latex writers - parse title, author, date before body.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1729 788f1e2b-df1e-0410-8736-df70ead52e1b

commit2a9ac1e65a2e1c4617a937f1c6a79f551d8637c5 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 31 Dec 2009, 01:16 (17 years ago) parent7dc43d3
2 files changed+10−10
src/Text/Pandoc/Writers/ConTeXt.hs+7−7 src/Text/Pandoc/Writers/LaTeX.hs+3−3
src/Text/Pandoc/Writers/ConTeXt.hs+7−7
@@ -57,6 +57,13 @@ writeConTeXt options document =
5757
5858pandocToConTeXt :: WriterOptions -> Pandoc -> State WriterState String
5959pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do
60+ titletext <- if null title
61+ then return ""
62+ else liftM render $ inlineListToConTeXt title
63+ authorstext <- mapM (liftM render . inlineListToConTeXt) authors
64+ datetext <- if null date
65+ then return ""
66+ else liftM render $ inlineListToConTeXt date
6067 body <- blockListToConTeXt blocks
6168 let before = if null (writerIncludeBefore options)
6269 then empty
@@ -65,13 +72,6 @@ pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do
6572 then empty
6673 else text $ writerIncludeAfter options
6774 let main = render $ before $$ body $$ after
68− titletext <- if null title
69− then return ""
70− else liftM render $ inlineListToConTeXt title
71− authorstext <- mapM (liftM render . inlineListToConTeXt) authors
72− datetext <- if null date
73− then return ""
74− else liftM render $ inlineListToConTeXt date
7575 let context = writerVariables options ++
7676 [ ("toc", if writerTableOfContents options then "yes" else "")
7777 , ("body", main)
src/Text/Pandoc/Writers/LaTeX.hs+3−3
@@ -52,6 +52,9 @@ writeLaTeX options document =
5252
5353pandocToLaTeX :: WriterOptions -> Pandoc -> State WriterState String
5454pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
55+ titletext <- liftM render $ inlineListToLaTeX title
56+ authorsText <- mapM (liftM render . inlineListToLaTeX) authors
57+ dateText <- liftM render $ inlineListToLaTeX date
5558 body <- blockListToLaTeX blocks
5659 let before = if null (writerIncludeBefore options)
5760 then empty
@@ -60,9 +63,6 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
6063 then empty
6164 else text $ writerIncludeAfter options
6265 let main = render $ before $$ body $$ after
63− titletext <- liftM render $ inlineListToLaTeX title
64− authorsText <- mapM (liftM render . inlineListToLaTeX) authors
65− dateText <- liftM render $ inlineListToLaTeX date
6666 let context = writerVariables options ++
6767 [ ("toc", if writerTableOfContents options then "yes" else "")
6868 , ("body", main)