generate
Generates a table of contents from a flat sequence of headings, based on their depth.
Example:
H1 ABC
H2 DEF
H2 GHI
H3 JKL
H2 MNO
H1 PQR
Content copied to clipboard
Should generate:
- ABC
- DEF
- GHI
- JKL
- MNO
- PQR
Content copied to clipboard
Return
the generated table of contents
Parameters
headings
flat sequence of headings