Closed NsLib closed 10 years ago
I use the following code to generate markdown toc
toc
class VimwikiTocRenderer(HtmlTocRenderer, LinkPreprocessor): pass ... toc_renderer = VimwikiTocRenderer() to_toc = Markdown(toc_renderer, extensions = EXT_NO_INTRA_EMPHASIS | EXT_AUTOLINK | EXT_SPACE_HEADERS) toc_content = to_toc.render(input_file)
However when I use a python code block like below, it treated # -*- coding: utf-8 -*- as toc too.
python code block
# -*- coding: utf-8 -*-
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import sys #...
If you're using EXT_FENCED_CODE to render the document you should also use it when rendering a TOC.
EXT_FENCED_CODE
Yep ~ I tried this and it works. thx so much~
I use the following code to generate markdown
toc
However when I use a
python code block
like below, it treated# -*- coding: utf-8 -*-
astoc
too.