Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@mdit-vue/plugin-toc
Advanced tools
A markdown-it plugin to generate table-of-contents that compatible with Vue.js
A markdown-it plugin to generate table-of-contents (TOC) that compatible with Vue.js.
This plugin is basically a fork of markdown-it-toc-done-right, with following enhancement:
html_inline
tags in headings to support vue components.npm i @mdit-vue/plugin-toc
import MarkdownIt from 'markdown-it';
import { tocPlugin } from '@mdit-vue/plugin-toc';
const md = MarkdownIt({ html: true }).use(tocPlugin, {
// options
});
Type: RegExp
Default: /^\[\[toc\]\]$/i
Details:
The pattern serving as the TOC placeholder in your markdown.
Type: (str: string) => string
Default: slugify
from @mdit-vue/shared
Details:
A custom slugification function.
The default slugify function comes from @mdit-vue/shared package.
When using this plugin with markdown-it-anchor (recommended), this option will be ignored because the id
of the headings have already been determined by markdown-it-anchor's slugify
option.
Type: (str: string) => string
Details:
A function for formatting headings.
Type: number[]
Default: [2, 3]
Details:
Heading level that going to be included in the TOC.
When using this plugin with markdown-it-anchor (recommended), this option should be a subset of markdown-it-anchor's level
option to ensure the target links are existed.
Type: string
Default: 'nav'
Details:
HTML tag of the TOC container.
Type: string
Default: 'table-of-contents'
Details:
The class for the TOC container.
Type: 'ul' | 'ol'
Default: 'ul'
Details:
HTML tag of the TOC list.
Type: string
Default: ''
Details:
The class for the TOC list.
Type: string
Default: ''
Details:
The class for the <li>
tag.
Type: 'a' | 'router-link'
Default: 'a'
Details:
The tag of the link inside the <li>
tag.
You can set this option to render to links as vue-router's router-link.
Type: string
Default: ''
Details:
The class for the link inside the <li>
tag.
FAQs
A markdown-it plugin to generate table-of-contents that compatible with Vue.js
The npm package @mdit-vue/plugin-toc receives a total of 12,343 weekly downloads. As such, @mdit-vue/plugin-toc popularity was classified as popular.
We found that @mdit-vue/plugin-toc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.