Skip to main content

Module sections

Module sections 

Source
Expand description

Splitting a markdown body into sections and joining it back.

A body splits at its ## headings. A ## block larger than the limit splits further at ### , then at blank lines, then at line ends, and a single overlong line at a character boundary. Headings inside code fences are text. The split is lossless: join of split gives the body back whenever it opens with its # title line.

Functions§

join
The body of title and sections, sections in order.
order_between
An order strictly between before and after (either end open), or None when no integer fits and the page has to be renumbered.
renumber
Fresh orders for n sections: ORDER_GAP, 2 * ORDER_GAP, ….
split
split_with at SECTION_MAX_BYTES.
split_with
Splits body into its title and sections no larger than max bytes.