summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2017-12-21 12:46:38 -0500
committerJesse Rosenthal <jrosenthal@jhu.edu>2017-12-21 17:00:59 -0500
commit5b2c38a07db87318382efbcb94da2c349cb0a589 (patch)
tree6f0a6fefb5b70b1440567dc175d0b33d3b1a619f /src/Text/Pandoc
parentbd3ea723717b54e3853487bee7a48947fb73b68a (diff)
PowerPoint writer: Add ability to force size.
This replaces the more specific blockQuote runProp, which only affected the size of blockquotes. We can use this for notes, etc.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Powerpoint.hs b/src/Text/Pandoc/Writers/Powerpoint.hs
index c13b32d49..9743b8bc3 100644
--- a/src/Text/Pandoc/Writers/Powerpoint.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint.hs
@@ -302,6 +302,7 @@ data RunProps = RunProps { rPropBold :: Bool
, rLink :: Maybe (URL, String)
, rPropCode :: Bool
, rPropBlockQuote :: Bool
+ , rPropForceSize :: Maybe Pixels
} deriving (Show, Eq)
instance Default RunProps where
@@ -313,6 +314,7 @@ instance Default RunProps where
, rLink = Nothing
, rPropCode = False
, rPropBlockQuote = False
+ , rPropForceSize = Nothing
}
--------------------------------------------------
@@ -385,7 +387,7 @@ blockToParagraphs (CodeBlock attr str) =
-- TODO: work out the format
blockToParagraphs (BlockQuote blks) =
local (\r -> r{ envParaProps = (envParaProps r){pPropMarginLeft = Just 100}
- , envRunProps = (envRunProps r){rPropBlockQuote = True}})$
+ , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$
concatMapM blockToParagraphs blks
-- TODO: work out the format
blockToParagraphs (RawBlock _ _) = return []
@@ -1098,7 +1100,9 @@ paraElemToElement (Run rpr s) = do
let attrs =
if rPropCode rpr
then []
- else (if rPropBlockQuote rpr then [("sz", (show $ blockQuoteSize * 100))] else []) ++
+ else (case rPropForceSize rpr of
+ Just n -> [("sz", (show $ n * 100))]
+ Nothing -> []) ++
(if rPropBold rpr then [("b", "1")] else []) ++
(if rPropItalics rpr then [("i", "1")] else []) ++
(case rStrikethrough rpr of