This repository has been archived by the owner. It is now read-only.
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (16 sloc) 574 Bytes


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