@@ -59,6 +59,8 @@ module Text.Pandoc.Pretty (
5959 , hsep
6060 , vcat
6161 , vsep
62+ , braces
63+ , brackets
6264 )
6365
6466where
@@ -393,3 +395,10 @@ chop n cs = case break (=='\n') cs of
393395 else take n xs : chop n (drop n xs ++ ys)
394396 where len = length xs
395397
398+-- | Puts a 'Doc' in curly braces.
399+braces :: Doc -> Doc
400+braces d = char '{' <> d <> char '}'
401+
402+-- | Puts a 'Doc' in square brackets.
403+brackets :: Doc -> Doc
404+brackets d = char '[' <> d <> char ']'