Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A little Markdown filter for numbered sections & a table of contents
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
mdtoc.rb
readme.md

readme.md

mdtoc

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 src.md | markdown

Released into the public domain. Sam Stephenson sstephenson@gmail.com 2011-04-30

Something went wrong with that request. Please try again.