diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2018-01-12 09:24:15 -0500 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2018-01-12 09:24:15 -0500 |
commit | 0b66b5652393673fe0b49581e7afdd822020071c (patch) | |
tree | 9aa464f160bf9217eec39115dba14a18a6643753 /src/Text/Pandoc/Writers | |
parent | 2afca42f777c1e15843f8895c0d3b959f9320f11 (diff) | |
download | pandoc-0b66b5652393673fe0b49581e7afdd822020071c.tar.gz |
Powerpoint writer: Clean up adding metadata slide
We want to count the slide numbers correctly if it's in there.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/Powerpoint.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/Powerpoint.hs b/src/Text/Pandoc/Writers/Powerpoint.hs index 990d90433..5a1d089a9 100644 --- a/src/Text/Pandoc/Writers/Powerpoint.hs +++ b/src/Text/Pandoc/Writers/Powerpoint.hs @@ -679,18 +679,20 @@ getMetaSlide = do blocksToPresentation :: PandocMonad m => [Block] -> P m Presentation blocksToPresentation blks = do + metadataslide <- getMetaSlide + let bodyStartNum = case metadataslide of + Just _ -> 2 + Nothing -> 1 blksLst <- splitBlocks blks slides <- mapM (\(bs, n) -> local (\st -> st{envCurSlideId = n}) (blocksToSlide bs)) - (zip blksLst [1..]) + (zip blksLst [bodyStartNum..]) let noteSlidesNum = length blksLst + 1 noteSlides <- local (\st -> st {envCurSlideId = noteSlidesNum}) makeNotesSlides - let slides' = slides ++ noteSlides - metadataslide <- getMetaSlide presSize <- asks envPresentationSize - return $ case metadataslide of - Just metadataslide' -> Presentation presSize $ metadataslide' : slides' - Nothing -> Presentation presSize slides' + return $ + Presentation presSize $ + (maybeToList metadataslide) ++ slides ++ noteSlides -------------------------------------------------------------------- |