# markdown-it-github-toc

> markdown-it plugin to add toc and anchor links in headings

Latest version **3.2.4** (published 2017-03-02) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.4 |
| Published | 2017-03-02 |
| First published | 2016-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Tyler Long |
| Maintainers | tylerlong |
| Keywords | makrdown-it, makrdown-it-plugin, markdown, toc, anchor |

## Links

- npm: https://www.npmjs.com/package/markdown-it-github-toc
- Repository: https://github.com/tylingsoft/markdown-it-github-toc
- Homepage: https://github.com/tylingsoft/markdown-it-github-toc#readme
- Issues: https://github.com/tylingsoft/markdown-it-github-toc/issues
- npm.io page: https://npm.io/package/markdown-it-github-toc

## Dependencies (1)

- [uslug](https://npm.io/package/uslug.md) ^1.0.4

## 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

- 3.2.4 (latest) — 2017-03-02
- 3.2.3 — 2017-02-14
- 3.2.2 — 2017-02-14
- 3.2.0 — 2017-02-13
- 3.1.0 — 2016-12-08
- 3.0.3 — 2016-11-09
- 3.0.2 — 2016-11-09
- 3.0.1 — 2016-11-09
- 3.0.0 — 2016-04-09
- 2.1.0 — 2016-01-17

## README

# markdown-it-github-toc

markdown-it plugin to add toc and GitHub style heading anchors


## Installation

```console
$ npm install markdown-it-github-toc
```


## Usage

```js
import markdownIt from "markdown-it"
import markdownItGithubToc from "markdown-it-github-toc"

markdownIt({
    html: true,
    linkify: true,
    typography: true,
  })
    .use(markdownItGithubToc, {
      // ...options
    })
    .render(md)
```


### Options

#### `toc`

(default: `true`)

Allow you to enable/disable the toc transformation of `[toc]`

#### `tocClassName`

(default: `"markdownIt-TOC"`)

Option to customize html class of the `<ul>` wrapping the toc

#### `tocFirstLevel`

(default: `1`)

Allow you to skip some heading level. Example: use 2 if you want to skip `<h1>`
from the TOC.

#### `tocLastLevel`

(default: `6`)

Allow you to skip some heading level. Example: use 5 if you want to skip `<h6>`
from the TOC.

#### `anchorLink`

(default: `true`)

Allow you to enable/disable the anchor link in the headings

#### `anchorLinkSymbol`

(default: `"#"`)

Allow you to customize the anchor link symbol

#### `anchorLinkSpace`

(default: `true`)

Allow you to enable/disable inserting a space between the anchor link and heading.

#### `anchorLinkSymbolClassName`

(default: `null`)

Allow you to customize the anchor link symbol class name. If not null, symbol will be rendered as `<span class="anchorLinkSymbolClassName">anchorLinkSymbol</span>`.

#### `anchorLinkBefore`

(default: `true`)

Allow you to prepend/append the anchor link in the headings

#### `anchorClassName`

(default: `"markdownIt-Anchor"`)

Allow you to customize the anchor link class

#### `resetIds`

(default: `true`)

Allow you to reset (or not) ids incrementation. Use it if you will have multiple
documents on the same page.

#### `indentation`

(default: `"  "`)

Allow you to customize indentation


## License

MIT

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