Prettyprinter section protocol
Factor handbook » Developer tools » The prettyprinter » Extending the prettyprinter » Prettyprinter sections

Prev:block> ( -- )


Prettyprinter sections must subclass section, and they must also obey a protocol.

Layout queries:
section-fits? ( section -- ? )

indent-section? ( section -- ? )

unindent-first-line? ( section -- ? )

newline-after? ( section -- ? )

short-section? ( section -- ? )


Printing sections:
short-section ( section -- )

long-section ( section -- )


Utilities to use when implementing sections:
new-section ( length class -- section )

new-block ( class -- block )

add-section ( section -- )