From 956425709d63b01c801ebb91dd867a08bfe76eb0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 1 Jul 2013 20:47:26 -0700 Subject: Created Text.Pandoc.Writers.Shared, improved metaToJSON. * Text.Pandoc.Writers.Shared contains shared functions used only in writers. * metaToJSON now takes a WriterOptions parameter, and will return an empty object if standalone is not specified. --- src/Text/Pandoc/Writers/RST.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc/Writers/RST.hs') diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 45e077f0d..606793842 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -34,6 +34,7 @@ module Text.Pandoc.Writers.RST ( writeRST ) where import Text.Pandoc.Definition import Text.Pandoc.Options import Text.Pandoc.Shared +import Text.Pandoc.Writers.Shared import Text.Pandoc.Templates (renderTemplate') import Text.Pandoc.Builder (deleteMeta) import Data.List ( isPrefixOf, intersperse, transpose ) @@ -72,10 +73,10 @@ pandocToRST (Pandoc meta blocks) = do Just (MetaBlocks [Plain xs]) -> xs _ -> [] title <- titleToRST (docTitle meta) subtit - metadata <- metaToJSON (fmap (render colwidth) . blockListToRST) - (fmap (trimr . render colwidth) . inlineListToRST) - (writerVariables opts) - $ deleteMeta "title" $ deleteMeta "subtitle" meta + metadata <- metaToJSON opts + (fmap (render colwidth) . blockListToRST) + (fmap (trimr . render colwidth) . inlineListToRST) + $ deleteMeta "title" $ deleteMeta "subtitle" meta body <- blockListToRST blocks notes <- liftM (reverse . stNotes) get >>= notesToRST -- note that the notes may contain refs, so we do them first -- cgit v1.2.3