# markdown-it-toc

> Adds syntax for an automatically generated table of contents to markdown-it markdown parser.

Latest version **1.1.0** (published 2015-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-it-toc
pnpm add markdown-it-toc
yarn add markdown-it-toc
bun add markdown-it-toc
```

## Health

**Score 5/100 (F)** — status: abandoned.

Warnings: low downloads; no types; no esm support; has vulnerabilities.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-04-09 |
| First published | 2015-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 1 |
| Install scripts | no |
| Author | Sam Chrisinger |
| Maintainers | samchrisinger |
| Keywords | markdown, markdown-it, markdown-it-plugin |

## Links

- npm: https://www.npmjs.com/package/markdown-it-toc
- Repository: https://github.com/samchrisinger/markdown-it-toc
- Issues: https://github.com/samchrisinger/markdown-it-toc/issues
- npm.io page: https://npm.io/package/markdown-it-toc

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-04-09
- 1.0.2 (markdown-it) — 2015-02-26
- 1.0.4 — 2015-03-16
- 1.0.3 — 2015-02-27

## README

# markdown-it-toc

> markdown-it plugin for adding a table of contents to markdown documents

## Usage

#### Enable plugin

```js
var md = require('markdown-it')({
  html: true,
  linkify: true,
  typography: true
}).use(require('markdown-it-toc')); // <-- this use(package_name) is required
```

#### Example

```md
@[toc](Title)
```

Adding this tag with add anchors to each ```<h[n]>``` tag on your document, and will add a ```<ul>``` of hyperlinks pointing to these places on the page.

The end results looks like:

```html
<p>
     <h3>Title</h3>
     <ul>
	<li><a href="...">Heading 1</a></li>
	...
	... 
     </ul> 
</p>
...
...
<h1><a href="..."></a>Heading 1</h1>
```

### Testing

To run the tests use:
```bash
make test
```

---
_Source: https://npm.io/package/markdown-it-toc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
