@hackage doclayout0.5.0.1
A prettyprinting library for laying out text documents.
Categories
License
BSD-3-Clause
Maintainer
jgm@berkeley.edu
Links
Versions
Installation
Dependencies (7)
- base >=4.12 && <5
- containers
- emojis >=0.1.2
- mtl
- safe
- semigroups >=0.18 && <0.19 Show all…
Dependents (11)
@hackage/uniform-pandoc, @hackage/gridtables, @hackage/uniform-latex2pdf, @hackage/hledger-ui, @hackage/table-layout, @hackage/doctemplates, Show all…
doclayout
This is a prettyprinting library designed for laying out plain-text documents. It originated in the pandoc module Text.Pandoc.Pretty, and its development has been guided by pandoc's needs in rendering wrapped textual documents.
In supports wrapping of text on breaking spaces, indentation and other line prefixes, blank lines, and tabular content.
Example:
Text.DocLayout> mydoc = hang 2 "- " (text "foo" <+> text "bar")
Text.DocLayout> putStrLn $ render (Just 20) mydoc
- foo bar
Text.DocLayout> putStrLn $ render (Just 10) (prefixed "> " (mydoc $+$ mydoc))
> - foo
> bar
>
> - foo
> bar
The Doc type may be parameterized to either String or
(strict or lazy) Text, depending on the desired render target.