Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

@centerforopenscience/markdown-it-toc

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Issues
File Explorer

Advanced tools

@centerforopenscience/markdown-it-toc

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

    1.1.1latest
    GitHub

Version published
Maintainers
1
Weekly downloads
806
increased by38.73%

Weekly downloads

Readme

Source

markdown-it-toc

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

Usage

Enable plugin
var md = require('markdown-it')({ html: true, linkify: true, typography: true }).use(require('markdown-it-toc')); // <-- this use(package_name) is required
Example
@[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:

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

npm test

Keywords

FAQs

Last updated on 19 Jul 2017

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc