git.iko.soy/typeable/pandoc
on master help sign in
PowerPoint writer: Register notes to state.

When we encounter a note, we write it to the state directory of notes, and input a superscript.

commitf76b4fc497706c4939c51138384ac1414b6f8b08 authorJesse Rosenthal <jrosenthal@jhu.edu> dateThu 21 Dec 2017, 11:45 (9 years ago) parentd6c9e4f
1 file changed+8
src/Text/Pandoc/Writers/Powerpoint.hs+8
src/Text/Pandoc/Writers/Powerpoint.hs+8
@@ -353,6 +353,14 @@ inlineToParElems (Code _ str) = do
353353 inlineToParElems $ Str str
354354inlineToParElems (Math mathtype str) =
355355 return [MathElem mathtype (TeXString str)]
356+inlineToParElems (Note blks) = do
357+ notes <- gets stNoteIds
358+ let maxNoteId = case M.keys notes of
359+ [] -> 0
360+ lst -> maximum lst
361+ curNoteId = maxNoteId + 1
362+ modify $ \st -> st { stNoteIds = M.insert curNoteId blks notes }
363+ inlineToParElems $ Superscript [Str $ show curNoteId]
356364inlineToParElems (Span _ ils) = concatMapM inlineToParElems ils
357365inlineToParElems (RawInline _ _) = return []
358366inlineToParElems _ = return []