jgm/doclayout

A prettyprinting library designed for laying out plain text documents

24

stars

178

commits

Haskell

primary language

Sep 5, 2026

updated

README

doclayout

CI
tests

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.

Contributors

jgm

143 commits

Xitian9

22 commits

silby

11 commits

sjakobi

2 commits

jgm/doclayout

A prettyprinting library designed for laying out plain text documents

24

stars

178

commits

Haskell

primary language

Sep 5, 2026

updated

README

doclayout

CI
tests

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.

Contributors

jgm

143 commits

Xitian9

22 commits

silby

11 commits

sjakobi

2 commits

Languages

Haskell

99.6%