This module offers a high-level and functional interface to the Format module of the OCaml standard library. It is a pretty-printing facility, i.e. it takes as input some code represented as a tree and formats this code into the most visually satisfying result, breaking and indenting lines of code where appropriate.
Input data must be first modelled and converted into a tree using 3 kinds of nodes:
- labelled nodes
Atoms represent any text that is guaranteed to be printed as-is. Lists can model any sequence of items such as arrays of data or lists of definitions that are labelled with something like "int main", "let x =" or "x:".
Published: 06 Jun 2022
This project is unmaintained. Pull requests won't be reviewed. If you would like to contribute, please request a transfer to ocaml-community.
Easy-format: indentation made easy
The documentation is at https://mjambon.github.io/mjambon2016/easy-format.html
Installation requires dune (formerly known as jbuilder) and ocamlfind.
$ make install
$ make uninstall
Some examples can be run with
make test before installing.
More examples that require Easy-format to be installed and possibly dependencies on other packages can be found in the
Port documentation from old website to a better place, possibly https://readthedocs.org/.
Switch from pure
jbuilderfor both build/install and development.
We're looking for an official maintainer for the library and its documentation.