@@ -33,6 +33,7 @@ module Text.Pandoc.Writers.Powerpoint.Presentation ( documentToPresentation
33 , TableProps(..)
33 , TableProps(..)
34 , Strikethrough(..)
34 , Strikethrough(..)
35 , Capitals(..)
35 , Capitals(..)
36 , PicProps(..)
37 , PicProps(..)
38 , TeXString(..)
39 , TeXString(..)
@@ -226,6 +227,7 @@ data ParaProps = ParaProps { pPropMarginLeft :: Maybe Pixels
226 , pPropBullet :: Maybe BulletType
227 , pPropBullet :: Maybe BulletType
227 , pPropAlign :: Maybe Algnment
228 , pPropAlign :: Maybe Algnment
228 , pPropSpaceBefore :: Maybe Pixels
229 , pPropSpaceBefore :: Maybe Pixels
230+ , pPropIndent :: Maybe Pixels
229 } deriving (Show, Eq)
231 } deriving (Show, Eq)
231instance Default ParaProps where
233instance Default ParaProps where
@@ -235,6 +237,7 @@ instance Default ParaProps where
235 , pPropBullet = Nothing
237 , pPropBullet = Nothing
236 , pPropAlign = Nothing
238 , pPropAlign = Nothing
237 , pPropSpaceBefore = Nothing
239 , pPropSpaceBefore = Nothing
240+ , pPropIndent = Just 0
240newtype TeXString = TeXString {unTeXString :: String}
243newtype TeXString = TeXString {unTeXString :: String}
@@ -411,18 +414,23 @@ blockToParagraphs (LineBlock ilsList) = do
411 pProps <- asks envParaProps
414 pProps <- asks envParaProps
412 return [Paragraph pProps parElems]
415 return [Paragraph pProps parElems]
413-- TODO: work out the attributes
416-- TODO: work out the attributes
414−blockToParagraphs (CodeBlock attr str) =
417+blockToParagraphs (CodeBlock attr str) = do
418+ pProps <- asks envParaProps
415− local (\r -> r{ envParaProps = def{pPropMarginLeft = Just 100}
419+ local (\r -> r{ envParaProps = def{ pPropMarginLeft = Nothing
420+ , pPropBullet = Nothing
421+ , pPropLevel = pPropLevel pProps
422+ , pPropIndent = Just 0
416 , envRunProps = (envRunProps r){rPropCode = True}}) $ do
424 , envRunProps = (envRunProps r){rPropCode = True}}) $ do
417− mbSty <- writerHighlightStyle <$> asks envOpts
425+ mbSty <- writerHighlightStyle <$> asks envOpts
418− synMap <- writerSyntaxMap <$> asks envOpts
426+ synMap <- writerSyntaxMap <$> asks envOpts
419− case mbSty of
427+ case mbSty of
420− Just sty ->
428+ Just sty ->
421− case highlight synMap (formatSourceLines sty) attr str of
429+ case highlight synMap (formatSourceLines sty) attr str of
422− Right pElems -> do pProps <- asks envParaProps
430+ Right pElems -> do pPropsNew <- asks envParaProps
423− return [Paragraph pProps pElems]
431+ return [Paragraph pPropsNew pElems]
424− Left _ -> blockToParagraphs $ Para [Str str]
432+ Left _ -> blockToParagraphs $ Para [Str str]
425− Nothing -> blockToParagraphs $ Para [Str str]
433+ Nothing -> blockToParagraphs $ Para [Str str]
426-- We can't yet do incremental lists, but we should render a
434-- We can't yet do incremental lists, but we should render a
427-- (BlockQuote List) as a list to maintain compatibility with other
435-- (BlockQuote List) as a list to maintain compatibility with other
428-- formats.
436-- formats.
@@ -431,7 +439,9 @@ blockToParagraphs (BlockQuote (blk : blks)) | isListType blk = do
431 ps' <- blockToParagraphs $ BlockQuote blks
439 ps' <- blockToParagraphs $ BlockQuote blks
432 return $ ps ++ ps'
440 return $ ps ++ ps'
433blockToParagraphs (BlockQuote blks) =
441blockToParagraphs (BlockQuote blks) =
434− local (\r -> r{ envParaProps = (envParaProps r){pPropMarginLeft = Just 100}
442+ local (\r -> r{ envParaProps = (envParaProps r){ pPropMarginLeft = Just 100
443+ , pPropIndent = Just 0
435 , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$
445 , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$
436 concatMapM blockToParagraphs blks
446 concatMapM blockToParagraphs blks
437-- TODO: work out the format
447-- TODO: work out the format
@@ -455,6 +465,7 @@ blockToParagraphs (BulletList blksLst) = do
455 , envParaProps = pProps{ pPropLevel = lvl + 1
465 , envParaProps = pProps{ pPropLevel = lvl + 1
456 , pPropBullet = Just Bullet
466 , pPropBullet = Just Bullet
457 , pPropMarginLeft = Nothing
467 , pPropMarginLeft = Nothing
468+ , pPropIndent = Nothing
459 concatMapM multiParBullet blksLst
470 concatMapM multiParBullet blksLst
460blockToParagraphs (OrderedList listAttr blksLst) = do
471blockToParagraphs (OrderedList listAttr blksLst) = do
@@ -464,6 +475,7 @@ blockToParagraphs (OrderedList listAttr blksLst) = do
464 , envParaProps = pProps{ pPropLevel = lvl + 1
475 , envParaProps = pProps{ pPropLevel = lvl + 1
465 , pPropBullet = Just (AutoNumbering listAttr)
476 , pPropBullet = Just (AutoNumbering listAttr)
466 , pPropMarginLeft = Nothing
477 , pPropMarginLeft = Nothing
478+ , pPropIndent = Nothing
468 concatMapM multiParBullet blksLst
480 concatMapM multiParBullet blksLst
469blockToParagraphs (DefinitionList entries) = do
481blockToParagraphs (DefinitionList entries) = do