Socket
Socket
Sign inDemoInstall

@centerforopenscience/markdown-it-toc

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @centerforopenscience/markdown-it-toc

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


Version published
Weekly downloads
242
decreased by-54.25%
Maintainers
1
Install size
9.36 kB
Created
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 for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • 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