package lsp
Install
Dune Dependency
Authors
Maintainers
Sources
md5=2c19731536a4f62923554c1947c39211
sha512=9bc252e2564fe6c9017b5ee1b2c4ddebf73c4be4b2a3d48f1d61b6ec1910a2cb9f4fa4952a7a6d89482c28ddbad8e0d9c34c206a1b2fe42bb2c3a7156aa953e9
doc/lsp.stdune/Stdune/Pp/index.html
Module Stdune.Pp
Source
Pretty printers
A document that is not yet rendered. The argument is the type of tags in the document. For instance tags might be used for styles.
Basic combinators
concat ?sep l
prints elements in l
separated by sep
. sep
defaults to nop
.
Convenience function for List.map
followed by concat
Print a bunch of text. The line may be broken at any spaces in the text.
Same as text
but take a format string as argument.
Break hints
Either a newline or a space, depending on whether the line is broken at this point.
Either a newline or nothing, depending on whether the line is broken at this point.
Either a newline or nspaces
spaces. If it is a newline, shift
is added to the indentation level.
Boxes
Boxes are the basic components to control the layout of the text. Break hints such as space
and cut
may cause the line to be broken, depending on the splitting rules. Whenever a line is split, the rest of the material printed in the box is indented with indent
.
Try to put as much as possible on each line. Additionally, a break hint always break the line if the breaking would reduce the indentation level (break
with negative shift
value).
If possible, print everything on one line. Otherwise, behave as a vbox
Common convenience functions
enumerate l ~f
produces an enumeration of the form:
- item1 - item2 - item3 ...
chain l ~f
is used to print a succession of items that follow each other. It produces an output of this form:
item1 -> item2 -> item3 ...
Operators
Rendering
val render :
Format.formatter ->
'a t ->
tag_handler:(Format.formatter -> 'a -> 'a t -> unit) ->
unit
Render a document to a classic formatter