austgl / python-markdown2

Automatically exported from code.google.com/p/python-markdown2
Other
0 stars 0 forks source link

Extra toc, Table of Contents #49

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to find more information on the development of extra toc, I am 
planning to use it. But I really found nothing on issues, author's blog, or 
group.

I downloaded the 1.0.1.17 and it's not there. So, I checkout r263.

I have to run with `-v` to get the HTML code of toc from debugging message, e.g.

    echo '## Heading' > /tmp/test ; markdown2.py -v -x toc /tmp/test
    <h2 id="heading">Heading</h2>
    DEBUG:markdown:toc_html: <ul>
      <li><a href="#heading">Heading</a></li>
    </ul>

I think toc is still not ready for stable usage. But I want to know how it 
would be used. I hope I open the issue can help or the author can clearly tell 
us.

In normal usage, we wouldn't want to copy the output of debugging message and 
paste it into the markdown source then generate again. So, there must be some 
magic code to let markdown2.py to replace with HTML of toc when generating HTML 
code, perhaps `<!-- TOC -->`?

Another issue I am thinking is, even toc needs a header, for example

    ## Table of Contents
    <!-- TOC -->

How to let markdown2.py know which is header of TOC and don't put it into HTML 
of toc? Moreover, skipping some deep headers like h5, h6?

(Sorry for opening issue instead of posting on group, but I do think this is a 
better way to track down since toc seems certainly in future release)

Original issue reported on code.google.com by livibet...@gmail.com on 5 Nov 2010 at 5:25