pandoc-3.6.3: Conversion between markup formats

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 | Safe-Inferred
Language | Haskell2010

Text.Pandoc.XML.Light.Output

Contents

- Replacement for xml-light's Text.XML.Output

Description

This code is based on code from xml-light, released under the BSD3 license. We use a text Builder instead of ShowS.

Synopsis

- ppTopElement :: Element -> Text
- ppElement :: Element -> Text
- ppContent :: Content -> Text
- ppcElement :: ConfigPP -> Element -> Text
- ppcContent :: ConfigPP -> Content -> Text
- showTopElement :: Element -> Text
- showElement :: Element -> Text
- showContent :: Content -> Text
- useShortEmptyTags :: (QName -> Bool) -> ConfigPP -> ConfigPP
- defaultConfigPP :: ConfigPP
- data ConfigPP = ConfigPP {
  - shortEmptyTag :: QName -> Bool
  - prettify :: Bool
  }

# Replacement for xml-light's Text.XML.Output

ppTopElement :: Element -> Text #

Pretty printing renders XML documents faithfully, with the exception that whitespace may be added/removed in non-verbatim character data.

ppElement :: Element -> Text #

Pretty printing elements

ppContent :: Content -> Text #

Pretty printing content

ppcElement :: ConfigPP -> Element -> Text #

Pretty printing elements

ppcContent :: ConfigPP -> Content -> Text #

Pretty printing content

showTopElement :: Element -> Text #

Adds the ?xml? header.

showElement :: Element -> Text #

showContent :: Content -> Text #

useShortEmptyTags :: (QName -> Bool) -> ConfigPP -> ConfigPP #

The predicate specifies for which empty tags we should use XML's abbreviated notation /. This is useful if we are working with some XML-ish standards (such as certain versions of HTML) where some empty tags should always be displayed in the TAG/TAG form.

defaultConfigPP :: ConfigPP #

Default pretty orinting configuration. * Always use abbreviate empty tags.

data ConfigPP #

Constructors

ConfigPP |
Fields shortEmptyTag :: QName -> Bool prettify :: Bool