public static extractHeadings(source as String) as ArrayList<DeclarationNode>
Extracts all ATX headings (# .. ######) outside fenced code blocks as DeclarationNodes of kind DeclarationKind.SECTION.
| Parameter | Description |
|---|---|
source | Markdown document text. |
Ordered list of heading DeclarationNodes.
import klyn.code.markdown
headings = MarkdownAst.extractHeadings("# Title\n## Section A\n")
assert headings.size == 2
assert headings[0].name == "Title"
assert headings[1].name == "Section A"