pandoc-3.10: 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 Source #

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

ppElement :: Element -> Text Source #

Pretty printing elements

ppContent :: Content -> Text Source #

Pretty printing content

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 #

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

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 Source #

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

data ConfigPP Source #

Constructors

ConfigPP |

Fields

- shortEmptyTag :: QName -> Bool
- prettify :: Bool