aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Pretty.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Pretty.hs b/src/Text/Pandoc/Pretty.hs
index e8b27df91..950d9a406 100644
--- a/src/Text/Pandoc/Pretty.hs
+++ b/src/Text/Pandoc/Pretty.hs
@@ -59,6 +59,8 @@ module Text.Pandoc.Pretty (
, hsep
, vcat
, vsep
+ , braces
+ , brackets
)
where
@@ -393,3 +395,10 @@ chop n cs = case break (=='\n') cs of
else take n xs : chop n (drop n xs ++ ys)
where len = length xs
+-- | Puts a 'Doc' in curly braces.
+braces :: Doc -> Doc
+braces d = char '{' <> d <> char '}'
+
+-- | Puts a 'Doc' in square brackets.
+brackets :: Doc -> Doc
+brackets d = char '[' <> d <> char ']'