| Copyright | Copyright (C) 2007 Galois Inc. 2021-2024 John MacFarlane |
|---|---|
| License | GNU GPL, version 2 or above |
| Maintainer | John MacFarlane <jgm@berkeley.edu> |
| Stability | alpha |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Text.Pandoc.XML.Light.Output
Description
This code is based on code from xml-light, released under the BSD3 license. We use a TextBuilder (from the text-builder package) instead of ShowS.
Synopsis
- ppTopElement :: Element -> Text
- ppElement :: Element -> Text
- ppContent :: Content -> Text
- ppcTopElement :: ConfigPP -> Element -> Text
- ppcElement :: ConfigPP -> Element -> Text
- ppcContent :: ConfigPP -> Content -> Text
- showTopElement :: Element -> Text
- showElement :: Element -> Text
- showContent :: Content -> Text
- useShortEmptyTags :: (QName -> Bool) -> ConfigPP -> ConfigPP
- useInlineTags :: (QName -> Bool) -> ConfigPP -> ConfigPP
- defaultConfigPP :: ConfigPP
- prettyConfigPP :: ConfigPP
- data ConfigPP = ConfigPP {
- shortEmptyTag :: QName -> Bool
- inlineTag :: QName -> Bool
- prettify :: Bool
Replacement for xml-light's Text.XML.Output
ppTopElement :: Element -> Text Source #
Pretty printing renders XML documents faithfully, with the exception that whitespace may be added/removed in non-verbatim character data.
ppcTopElement :: ConfigPP -> Element -> Text Source #
Pretty printing renders XML documents faithfully, with the exception that whitespace may be added/removed in non-verbatim character data.
ppcElement :: ConfigPP -> Element -> Text Source #
Pretty printing elements
ppcContent :: ConfigPP -> Content -> Text Source #
Pretty printing content
showTopElement :: Element -> Text Source #
Adds the ?xml? header.
showElement :: Element -> Text Source #
showContent :: Content -> Text Source #
useInlineTags :: (QName -> Bool) -> ConfigPP -> ConfigPP Source #
The predicate specifies which tags should be treated as inline: when pretty-printing, the whole content of an inline element is kept on a single line, so that no whitespace is added inside it.
defaultConfigPP :: ConfigPP Source #
Default pretty orinting configuration. * Always use abbreviate empty tags.
prettyConfigPP :: ConfigPP Source #
A configuration that tries to make things pretty (possibly at the cost of changing the semantics a bit through adding white space.)