Markdown to create pages and table of contents?

后端 未结 30 2647
爱一瞬间的悲伤
爱一瞬间的悲伤 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条回答
  •  -上瘾入骨i
    2020-12-12 09:32

    Here's a useful method. Should produce clickable references in any MarkDown editor.

    # Table of contents
    1. [Introduction](#introduction)
    2. [Some paragraph](#paragraph1)
        1. [Sub paragraph](#subparagraph1)
    3. [Another paragraph](#paragraph2)
    
    ## This is the introduction 
    Some introduction text, formatted in heading 2 style
    
    ## Some paragraph 
    The first paragraph text
    
    ### Sub paragraph 
    This is a sub paragraph, formatted in heading 3 style
    
    ## Another paragraph 
    The second paragraph text
    

    Produces:

    Table of contents

    1. Introduction
    2. Some paragraph
      1. Sub paragraph
    3. Another paragraph

    This is the introduction

    Some introduction text, formatted in heading 2 style

    Some paragraph

    The first paragraph text

    Sub paragraph

    This is a sub paragraph, formatted in heading 3 style

    Another paragraph

    The second paragraph text

提交回复
热议问题