Skip to content

kevindaub/Markdown-TOC

 
 

Repository files navigation

Markdown-TOC

Generate TOC (table of contents) of headlines from parsed markdown file.

Features

  • Auto active plugin on markdown
  • Insert anchor for header <a id="markdown-header" name="header"></a>
  • Linking via anchor tags # A 1#a-1
  • Depth control[1-6] with depthFrom:1 and depthTo:6
  • Enable or disable links with withLinks:true
  • Refresh list on save with updateOnSave:true
  • Use ordered list (1. ..., 2. ...) with orderedList:true

Installation

ext install markdown-toc

Usage

  1. Open Markdown files.
  2. Move cursor to position where you want to insert TOC.
  3. Ctrl+Shift+P / F1.
  4. Input 'TOC Create'.
  5. TOC has inserted into document!

Configuration

attributes values defaults
depthFrom uint(1-6) 1
depthTo uint(1-6) 6
insertAnchor true or false false
withLinks true or false true
orderedList true or false false
updateOnSave true or false true

Default Settings

To change the default configuration settings for the Markdown-TOC extension, edit the user or workspace settings as described here. The available settings are as follows:

attributes values defaults
markdown-toc.depthFrom number(1-6) 1
markdown-toc.depthTo number(1-6) 6
markdown-toc.insertAnchor bool false
markdown-toc.withLinks bool true
markdown-toc.orderedList bool false
markdown-toc.updateOnSave bool true

Unique Settings

If you want to use a unique setting for a file, you can add attributes to <!-- TOC --> , just like:

<!-- TOC depthFrom:2 orderedList:true -->

<!-- /TOC -->

Contributors

  • rovest (Feature: Insert anchor)
  • zhiguang Wang(Fix: Recognised code to header list)
  • jgroom33 (Fix: Codeblock error)
  • satokaz (Fix: Codeblock error)

Question

If you have any question, you can contact with me:

License

The package is Open Source Software released under the License. It's developed by AlanWalk.

Links

About

MarkdownTOC(Table Of Contents) Plugin for Visual Studio Code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%