Skip to content

markdown-it plugin for generation a table of contents

License

Notifications You must be signed in to change notification settings

a7b0/markdown-it-contents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-it-contents

markdown-it plugin for generation a table of contents

Installation

npm install markdown-it-contents

Usage

{!toc}

The macros {!toc} will generate the table of contents for below headings only.

Example of load the plugin:

var markdown = require('markdown-it')();

markdown.use(require('markdown-it-contents'), {
    ..options
});

Options

var defaults = {
    // the max heading level in table of contents
    depth: 6,
    // a custom slugification function
    slugify: function(name) { /* code */},
    // a class for the container
    className: 'table-of-contents'
}

About

markdown-it plugin for generation a table of contents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published