getMarkdownOutline

Returns the hierarchy of sections.

package
getMarkdownOutline
(,
scope MarkdownSettings settings = null
)

Examples

auto mdText = "## first\n## second\n### third\n# fourth\n### fifth";
auto expected = [
    Section(2, " first", "first"),
    Section(2, " second", "second", [Section(3, " third", "third")]),
    Section(1, " fourth", "fourth", [Section(3, " fifth", "fifth")])
];
assert(getMarkdownOutline(mdText) == expected);

Meta