xml-prettify-text: XML pretty printer

[ efficient-xml-pretty-printer, gpl, library, program ] [ Propose Tags ] [ Report a vulnerability ]

XML pretty printer based on xml-prettify by David M. Rosenberg. Modified to work with Text instead of String and tuned for improved performance.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 1.0.0.1, 1.0.0.2, 1.0.0.3
Change log CHANGELOG.md
Dependencies base (>=4.14 && <4.16), mtl (>=2.2.2 && <2.3), optparse-applicative (>=0.16.1 && <0.17), protolude (>=0.3.0 && <0.4), text (>=1.2.4 && <1.3), text-show (>=3.9.2 && <3.10), with-utf8 (>=1.0.2 && <1.1), xml-prettify-text [details]
Tested with ghc ==8.8.3
License GPL-2.0-only
Copyright 2021 Marc Jakobi
Author Marc Jakobi
Maintainer Marc Jakobi <mrcjkb89@outlook.com>
Category Efficient XML pretty-printer
Home page https://github.com/MrcJkb/xml-prettify-text
Bug tracker https://github.com/MrcJkb/xml-prettify-text/issues
Source repo head: git clone https://github.com/MrcJkb/xml-prettify-text.git
Uploaded by MrcJkb at 2022-01-31T16:29:14Z
Distributions
Executables xml-prettify
Downloads 273 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-01-31 [all 1 reports]

Readme for xml-prettify-text-1.0.0.3

[back to package description]

xml-prettify-text

XML pretty printer based on xml-prettify by David M. Rosenberg. Modified to work with Text instead of String and tuned for improved performance.

Build status Hackage Stackage Lts Stackage Nightly GPL-2.0-only license

Usage

Usage: xml-prettify ((-f|--file FILE_NAME) | (-t|--text XML_TEXT))
                    [(-o|--out FILE_NAME) | (-c|--console)]
                    [--indent-style <TAB | SPACE SIZE>] [--eol <LF | CR | CRLF>]
  Pretty-prints XML text

Available options:
  -f,--file FILE_NAME      XML file to pretty-print
  -t,--text XML_TEXT       XML text to pretty-print
  -o,--out FILE_NAME       XML file to pretty-print to
  -c,--console             Output the pretty-printed XML to the console
  --indent-style <TAB | SPACE SIZE>
                           The indent style (TAB or SPACE
                           INDENT_SIZE) (default: SPACE 2)
  --eol <LF | CR | CRLF>   The line-break style: Line Feed (LF), Carriage Return
                           (CR), or both (CRLF) (default: LF)
  -h,--help                Show this help text

Motivation

Why re-implement xml-prettify?

  • I am not satisfied with the Text.PrettyPrint output.
  • xml-prettify produces good output, but with poor performance.
  • xml-prettify appears not to be maintained (I haven't been able to use it as a library in modern projects).
  • Some more configurability (see TODOs) would be great.
  • A good project for me to practise profiling and benchmarking in Haskell.

TODO

  • Port xml-prettify for use with Text
  • Refactor for better readability
  • Implement golden tests
  • Profile, benchmark & squeeze performance
  • Add options for specifying newlines, indent-style, indent-size, etc.
  • Create cli app