git.iko.soy/typeable/pandoc
on master help sign in
Definition lists and blockquotes
commit41b47ad613bef776aa2cc5b78522fb7305af85a3 authorJess Robinson <castaway@desert-island.me.uk> dateSun 19 Feb 2012, 16:22 (15 years ago) parent567d32c
1 file changed+10−17
src/Text/Pandoc/Writers/PseudoPod.hs+10−17
src/Text/Pandoc/Writers/PseudoPod.hs+10−17
@@ -213,17 +213,11 @@ blockToPseudoPod _ (CodeBlock _ str) = return $
213213 attrs = attrsToPseudoPod attribs
214214-}
215215
216+-- | =begin blockquote ?
216217blockToPseudoPod opts (BlockQuote blocks) = do
217− st <- get
218− -- if we're writing literate haskell, put a space before the bird tracks
219− -- so they won't be interpreted as lhs...
220− let leader = if writerLiterateHaskell opts
221− then " > "
222− else if stPlain st
223− then " "
224− else "> "
225218 contents <- blockListToPseudoPod opts blocks
226− return $ (prefixed leader contents) <> blankline
219+ return $ "=begin blockquote" <> blankline <> contents <> blankline <> "=end blockquote" <> blankline
220+
227221blockToPseudoPod opts (Table caption aligns widths headers rows) = do
228222 caption' <- inlineListToPseudoPod opts caption
229223 let caption'' = if null caption
@@ -311,6 +305,7 @@ orderedListItemToPseudoPod opts marker items = do
311305 return $ hang (writerTabStop opts) start $ contents <> cr
312306-}
313307
308+{-
314309-- | Convert definition list item (label, list of blocks) to markdown.
315310definitionListItemToPseudoPod :: WriterOptions
316311 -> ([Inline],[[Block]])
@@ -326,8 +321,8 @@ definitionListItemToPseudoPod opts (label, defs) = do
326321 defs' <- mapM (mapM (blockToPseudoPod opts)) defs
327322 let contents = vcat $ map (\d -> hang tabStop (leader <> sps) $ vcat d <> cr) defs'
328323 return $ labelText <> cr <> contents <> cr
324+-}
329325
330−{-
331326-- | Convert definition list item (label, list of blocks) to PseudoPod.
332327-- | =over / =item FOO / para / =back
333328definitionListItemToPseudoPod :: WriterOptions
@@ -337,13 +332,10 @@ definitionListItemToPseudoPod opts (label, defs) = do
337332 labelText <- inlineListToPseudoPod opts label
338333 -- each call to definitonListItemToPseudoPod is one label, which can have multiple defintions. (Each definition is a [Block].)
339334
340− defs' <- mapM (mapM (blockToPseudoPod opts)) defs
335+ defs' <- mapM (blockListToPseudoPod opts) defs
341336-- let contents = vcat $ map (\d -> "=item") $ vcat d <> cr) defs'
342− return $ "=item" <> labelText <> blankline <> vcat (vcat defs') <> blankline
337+ return $ "=item " <> labelText <> blankline <> vcat defs' <> blankline
343338
344−definitionListSubItemToPseudoPod :: WriterOptions -> ([Inline], [Block])
345−definitionListSubItemToPseudoPod opts (label, def) = do
346−-}
347339
348340-- | Convert list of Pandoc block elements to PseudoPod.
349341blockListToPseudoPod :: WriterOptions -- ^ Options
@@ -487,5 +479,6 @@ inlineToPseudoPod opts (Image alternate (source, tit)) = do
487479
488480-- | N<>
489481inlineToPseudoPod opts (Note blocks) = do
490− contents <- blockListToPseudoPod opts blocks
491− return $ "N<" <> contents <> ">"
482+-- contents <- blockListToPseudoPod opts blocks
483+ contents <- mapM (blockToPseudoPod opts) blocks
484+ return $ "N<" <> vcat contents <> ">"