Skip to main content

Module format

Module format 

Source
Expand description

Beancount file formatter.

Provides pretty-printing for beancount directives with configurable amount alignment.

Structs§

FormatConfig
Formatter configuration.

Enums§

Alignment
How to choose the alignment column for amounts.
FormatLine
A single rendered output line, classified for alignment.

Functions§

escape_string
Escape a string for output (handle quotes and backslashes).
format_directive_lines
Render a directive into format lines (the render phase).
format_directives
Format a list of directives to a string, aligning all of them together against shared, file-wide column widths in a single pass.
format_posting_line
Format the single-line representation of a posting, including the first same-line trailing comment.
posting_format_line
Build the FormatLine for a single posting line.
render_lines
Render a sequence of FormatLines into a single string, aligning all amount-bearing lines against the file-wide widths implied by alignment. Every line is terminated with \n.
resolve_alignment
Resolve alignment against a document’s full line set into a concrete alignment whose widths are fixed.