diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-12-19 10:13:11 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-12-19 10:13:11 -0800 |
commit | 6aa5010617bda83e86483f1bb809a61a74a3cf8a (patch) | |
tree | a243a05ca82b9de5932c3401ec9a3277e57485cb /src/Text | |
parent | 89bf3127654f152c1386014ab5b1588f6e80fc6f (diff) | |
download | pandoc-6aa5010617bda83e86483f1bb809a61a74a3cf8a.tar.gz |
Pretty: Added braces and brackets.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Pretty.hs | 9 |
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 ']' |