Automatic TOC in github-flavoured-markdown

后端 未结 17 1581
伪装坚强ぢ
伪装坚强ぢ 2020-12-12 09:24

Is it possible to generate an automatic Table of Contents using Github Flavoured Markdown?

17条回答
  •  有刺的猬
    2020-12-12 09:40

    For Github's Texteditor Atom check out this awesome plugin (or "package" in Atom-lingo), which generates "TOC (table of contents) of headlines from parsed markdown" files:

    markdown-toc

    Once installed as Atom-package you can use the shortcut ctrl-alt-c to insert a TOC based on your markdown-doc-structure at the current cursor position...

    Screenshots:

    Atom Keybindings

    markdown-toc gives you the following default key-bindings to control the plugin in Atom:

    • ctrl-alt-c => create TOC at cursor position
    • ctrl-alt-u => update TOC
    • ctrl-alt-r => delete TOC

    Plugin Features (from the project's README)

    • Auto linking via anchor tags, e.g. # A 1#a-1
    • Depth control [1-6] with depthFrom:1 and depthTo:6
    • Enable or disable links with withLinks:1
    • Refresh list on save with updateOnSave:1
    • Use ordered list (1. ..., 2. ...) with orderedList:0

提交回复
热议问题