A Markdown filter for generating numbered sections and a table of contents.
$ npm install -g mdtoc
mdtoc, make sure that the headings you want numbered and linked are in this format:
### Title ###
Note that the headings must have an equal number of octothorpes around the title text (in Markdown,
h2, and so on). The table of contents will be inserted before the first such heading.
lib/mdtoc.js exposes the
bin/mdtoc executable is Node-specific, and can be invoked like so:
$ mdtoc source.md $ mdtoc first.md second.md | markdown $ cat source.md | mdtoc $ cat first.md | mdtoc second.md third.md | markdown