Markdown to create pages and table of contents?

后端 未结 30 2639
爱一瞬间的悲伤
爱一瞬间的悲伤 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:36

    There are 2 way to create your TOC (summary) in your markdown document.

    1. Manually

    # My Table of content
    - [Section 1](#id-section1)
    - [Section 2](#id-section2)
    
    
    ## Section 1
    ## Section 2

    2. Programmatically

    You can use for example a script that generate summary for you, take a look to my project on github - summarizeMD -

    I've tried also other script/npm module (for example doctoc) but no one reproduce a TOC with working anchors.

提交回复
热议问题