summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2018-01-12 10:00:59 -0500
committerJesse Rosenthal <jrosenthal@jhu.edu>2018-01-12 10:00:59 -0500
commit4ce07c20d7f06da3519fa601b9d3df94a16d507e (patch)
treee1f3cb3bc558d4b6f2080d92f0d906ac19e859c6 /src/Text/Pandoc/Writers
parent53c48dd2c9417916bfaa15be15fad992c9659af9 (diff)
Powerpoint writer: Set notes slide number correctly
Previously, this hadn't been aware of a metadata slide. We also clarify the logic for setting the startnumber of different slide sections correctly.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint.hs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Writers/Powerpoint.hs b/src/Text/Pandoc/Writers/Powerpoint.hs
index 7b73d0ecb..ef9bfedff 100644
--- a/src/Text/Pandoc/Writers/Powerpoint.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint.hs
@@ -679,20 +679,18 @@ getMetaSlide = do
blocksToPresentation :: PandocMonad m => [Block] -> P m Presentation
blocksToPresentation blks = do
- metadataslide <- getMetaSlide
- let bodyStartNum = case metadataslide of
- Just _ -> 2
- Nothing -> 1
+ metadataslides <- maybeToList <$> getMetaSlide
+ let bodyStartNum = length metadataslides + 1
blksLst <- splitBlocks blks
- slides <- mapM
- (\(bs, n) -> local (\st -> st{envCurSlideId = n}) (blocksToSlide bs))
- (zip blksLst [bodyStartNum..])
- let noteSlidesNum = length blksLst + 1
- noteSlides <- local (\st -> st {envCurSlideId = noteSlidesNum}) makeNotesSlides
+ bodyslides <- mapM
+ (\(bs, n) -> local (\st -> st{envCurSlideId = n}) (blocksToSlide bs))
+ (zip blksLst [bodyStartNum..])
+ let noteStartNum = bodyStartNum + length bodyslides
+ noteSlides <- local (\st -> st {envCurSlideId = noteStartNum}) makeNotesSlides
presSize <- asks envPresentationSize
return $
Presentation presSize $
- (maybeToList metadataslide) ++ slides ++ noteSlides
+ metadataslides ++ bodyslides ++ noteSlides
--------------------------------------------------------------------