# markdown-it-toc-and-anchor [![circleci](https://badgen.net/circleci/github/medfreeman/markdown-it-toc-and-anchor/master)](https://circleci.com/gh/medfreeman/markdown-it-toc-and-anchor) [![AppVeyor Build Status](https://img.shields.io/appveyor/ci/medfreeman/markdown-it-toc-and-anchor.svg?label=windows%20build)](https://ci.appveyor.com/project/medfreeman/markdown-it-toc-and-anchor) [![Version](https://img.shields.io/npm/v/markdown-it-toc-and-anchor.svg)](https://github.com/medfreeman/markdown-it-toc-and-anchor/blob/master/CHANGELOG.md) [![Coverage Status](https://img.shields.io/coveralls/medfreeman/markdown-it-toc-and-anchor/master.svg)](https://coveralls.io/github/medfreeman/markdown-it-toc-and-anchor?branch=master) [![Dependency Status](https://img.shields.io/david/medfreeman/markdown-it-toc-and-anchor.svg)](https://david-dm.org/medfreeman/markdown-it-toc-and-anchor) > markdown-it plugin to add toc and anchor links in headings ## Installation ```console $ yarn add markdown-it-toc-and-anchor ``` ## Usage ### ES6 ```js import markdownIt from "markdown-it" import markdownItTocAndAnchor from "markdown-it-toc-and-anchor" markdownIt({ html: true, linkify: true, typographer: true, }) .use(markdownItTocAndAnchor, { // ...options }) .render(md) ``` ### ES5 / CommonJS ```js var markdownIt = require('markdown-it'), markdownItTocAndAnchor = require('markdown-it-toc-and-anchor').default; markdownIt({ html: true, linkify: true, typographer: true, }) .use(markdownItTocAndAnchor, { // ...options }) .render(md) ``` :information_source: Note that the 'default' property has to be used when requiring this plugin, this is due to the use of Babel 6 now making ES6 compliant exports ([Misunderstanding ES6 Modules, Upgrading Babel, Tears, and a Solution ](https://medium.com/@kentcdodds/misunderstanding-es6-modules-upgrading-babel-tears-and-a-solution-ad2d5ab93ce0#.enq6dfcnn)) ### Options #### `toc` (default: `true`) Allows you to enable/disable the toc transformation of `@[toc]` #### `tocClassName` (default: `"markdownIt-TOC"`) Option to customize html class of the `