Table of contents
Waylan Limberg
waylan at gmail.com
Thu Mar 5 09:02:09 EST 2009
On Thu, Mar 5, 2009 at 4:27 AM, Daniel Winterstein
<daniel.winterstein at gmail.com> wrote:
>
> I'm using Markdown in an app and would like to provide support for including
> a table of contents.
> Any suggestions for a syntax? Has anyone done this before?
Yes, Python-Markdown has an extension [1] that does this.
Unfortunately, its not documented properly yet (it hasn't been
officially released yet either), but it works on the same basic
premise as your third suggestion. It uses all the headers to build a
nested list and then either inserts that list at the location of the
marker ``[TOC]``, or if the marker is not found, at the beginning of
the document.
[1]: http://gitorious.org/projects/python-markdown/repos/mainline/blobs/master/markdown/extensions/toc.py
--
----
\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg
More information about the Markdown-Discuss
mailing list