diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2018-02-18 16:06:58 -0500 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2018-02-18 16:31:32 -0500 |
commit | 6562863ef1eae9796b89b9b995e63ad4e75359fb (patch) | |
tree | 81cd07f9d89ccac4326a6a28cf0aa8713c85d792 /src/Text/Pandoc | |
parent | 07f3aa178be1dda44cd5477089d26c26b9460751 (diff) | |
download | pandoc-6562863ef1eae9796b89b9b995e63ad4e75359fb.tar.gz |
Powerpoint writer: separate SpeakerNotes paragraphs with empy par
This will add a space between notes paragraphs, which seems more like
what most users would do by hand (press "enter" twice).
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/Powerpoint/Output.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 93d511dce..bc9c3193a 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -39,7 +39,7 @@ import Control.Monad.Reader import Control.Monad.State import Codec.Archive.Zip import Data.Char (toUpper) -import Data.List (intercalate, stripPrefix, nub, union, isPrefixOf) +import Data.List (intercalate, stripPrefix, nub, union, isPrefixOf, intersperse) import Data.Default import Text.Pandoc.Compat.Time (formatTime, defaultTimeLocale) import Data.Time.Clock (UTCTime) @@ -1205,14 +1205,18 @@ speakerNotesSlideImage = -- we want to wipe links from the speaker notes in the -- paragraphs. Powerpoint doesn't allow you to input them, and it -- would provide extra complications. -removeLinks :: Paragraph -> Paragraph -removeLinks paragraph = paragraph{paraElems = map f (paraElems paragraph)} +removeParaLinks :: Paragraph -> Paragraph +removeParaLinks paragraph = paragraph{paraElems = map f (paraElems paragraph)} where f (Run rProps s) = Run rProps{rLink=Nothing} s f pe = pe +-- put an empty paragraph between paragraphs for more expected spacing. +spaceParas :: [Paragraph] -> [Paragraph] +spaceParas = intersperse (Paragraph def []) + speakerNotesBody :: PandocMonad m => [Paragraph] -> P m Element speakerNotesBody paras = do - elements <- mapM paragraphToElement $ map removeLinks paras + elements <- mapM paragraphToElement $ spaceParas $ map removeParaLinks paras let txBody = mknode "p:txBody" [] $ [mknode "a:bodyPr" [] (), mknode "a:lstStyle" [] ()] ++ elements return $ |