format.pl -- Print formatted text to a terminal
This module is the core of the plain text rendering module, providing
format_paragraph/2 which formats a plain text block, respecting left and
right margins, text alignment, ANSI style elements, etc.
- format_paragraph(+Text, +Options)
- Format a paragraph to the current output. Options defined are:
- width(+Width)
- Width of a line. Default is 72.
- margin_left(+Indent)
- Indent all lines with Indent spaces.
- margin_right(+Margin)
- Additional right margin (same as reducing
width
)
- hang(+Hang)
- Additional indent for the first line. Can be negative.
- bullet(+Bullet)
- Bullet placed before the first line.
- text_align(Alignment)
- One of
left
, right
, center
or justify
- pad(+Char)
- If present, padd to the right using Char. Currently
Char must be ' '.
- trim_line(Line0, Line) is det
- Remove leading and trailing white space (
b(_,_)
) tokens from a line.
- words(+Input, -Words) is det[multifile]
- Turn the Input into a list of
w(Word, Len, Attributes)
terms.