Markdown to create pages and table of contents?

后端 未结 30 2651
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 08:49

I started to use markdown to take notes.

I use marked to view my markdown notes and its beautiful.

But as my notes get longer I find it diff

30条回答
  •  一整个雨季
    2020-12-12 09:38

    You could also use pandoc, the "swiss-army knife" for converting "one markup format into another". It can automatically generate a table of content in the output document if you supply the --toc argument.

    Hint: If you want a table of contents in html output, you also need to supply -s which generates a standalone document.

    Example shell command line:

    ./pandoc -s --toc input.md -o output.html
    

提交回复
热议问题