This repository has been archived by the owner. It is now read-only.
A little Markdown filter for numbered sections & a table of contents
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
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