Skip to content
A little Markdown filter for numbered sections & a table of contents
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A little Markdown filter that scans your document for headings, numbers them, adds anchors, and inserts a table of contents.

To use it, make sure the headings you want numbered and linked are in this format:

### Title ###

I.e. they must have an equal number of octothorpes around the title text. (In Markdown, # means h1, ## means h2, and so on.) The table of contents will be inserted before the first such heading.

Then run:

./mdtoc.rb | markdown

Released into the public domain. Sam Stephenson 2011-04-30

Something went wrong with that request. Please try again.