{"_id":"@mdit-vue/plugin-toc@4.0.0","bugs":{"url":"https://github.com/mdit-vue/mdit-vue/issues"},"dist":{"shasum":"79a0b0bf3c8cedd73324d2ff0a4def2797b7e112","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-toc/download/@mdit-vue/plugin-toc-4.0.0.tgz","fileCount":5,"integrity":"sha512-Rp5l7heAYej38W+F/eTYhS6xaF6XBTpvthqrxFQ5lgsv1dALTFfU5MW4bbTv9i6RKTkTeuGVUlTKomcUyOmnCA==","signatures":[{"sig":"MEUCIBtz/02SXa4HOePe7+HDPPd099YaBy5xNnTrwiGWpVBDAiEA7T9VkwZDChx7DyKBwZ47V+4A/SqOzoctQjqemdIFliI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIALMTXkcrD17o/KWmOYh4zqE7L7YOqxAQ5M0iMWDA37zAiEA7DZEZ6vgyKPluldErEsVwdmBOEdmGd3rx4Se9aIS88w="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mdit-vue%2fplugin-toc@4.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11481,"size":4048,"noattachment":false,"key":"/@mdit-vue/plugin-toc/-/@mdit-vue/plugin-toc-4.0.0.tgz"},"name":"@mdit-vue/plugin-toc","type":"module","types":"./dist/index.d.ts","author":{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"},"engines":{"node":">=20.19.0"},"exports":{".":"./dist/index.js","./package.json":"./package.json"},"gitHead":"62f17856a1a5dec0e33c6487453a927b82a5883b","license":"MIT","scripts":{"test":"vitest","build":"tsdown","clean":"rimraf ./dist"},"version":"4.0.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"d2dc9653-23ba-41b9-a916-fb4a79128e67"}},"homepage":"https://github.com/mdit-vue","keywords":["markdown-it","markdown-it-plugin","table-of-contents","toc","vue"],"repository":{"url":"git+https://github.com/mdit-vue/mdit-vue.git","type":"git"},"_npmVersion":"lerna/5.8.0/node@v26.13.0+x64 (linux)","description":"A markdown-it plugin to generate table-of-contents that compatible with Vue.js","directories":{},"maintainers":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"}],"_nodeVersion":"26.13.0","dependencies":{"markdown-it":"^15.0.3","@mdit-vue/types":"4.0.0","@mdit-vue/shared":"4.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.23.7","vitest":"^5.1.0","markdown-it-anchor":"^10.1.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-toc_4.0.0_1794239012121_0.6168115849406055"},"readme":"# @mdit-vue/plugin-toc\n\n[![npm](https://badgen.net/npm/v/@mdit-vue/plugin-toc)](https://www.npmjs.com/package/@mdit-vue/plugin-toc)\n[![license](https://badgen.net/github/license/mdit-vue/mdit-vue)](https://github.com/mdit-vue/mdit-vue/blob/main/LICENSE)\n\nA [markdown-it](https://github.com/markdown-it/markdown-it) plugin to generate table-of-contents (TOC) that compatible with [Vue.js](https://vuejs.org).\n\nThis plugin is basically a fork of [markdown-it-toc-done-right](https://github.com/nagaozen/markdown-it-toc-done-right), with following enhancement:\n\n- Allows `html_inline` tags in headings to support vue components.\n- Supports [containerTag](#containertag), [listTag](#listtag) and [linkTag](#linktag).\n- Only allows array in [level](#level) option.\n- Code refactor and optimizations.\n\n## Install\n\n```sh\nnpm i @mdit-vue/plugin-toc\n```\n\n## Usage\n\n```ts\nimport { tocPlugin } from '@mdit-vue/plugin-toc';\nimport MarkdownIt from 'markdown-it';\n\nconst md = MarkdownIt({ html: true }).use(tocPlugin, {\n  // options\n});\n```\n\n## Options\n\n### pattern\n\n- Type: `RegExp`\n\n- Default: `/^\\[\\[toc\\]\\]$/i`\n\n- Details:\n\n  The pattern serving as the TOC placeholder in your markdown.\n\n### slugify\n\n- Type: `(str: string) => string`\n\n- Default: `slugify` from `@mdit-vue/shared`\n\n- Details:\n\n  A custom slugification function.\n\n  The default slugify function comes from [@mdit-vue/shared](https://github.com/mdit-vue/mdit-vue/tree/main/packages/shared) package.\n\n  When using this plugin with [markdown-it-anchor](https://github.com/valeriangalliat/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.\n\n### format\n\n- Type: `(str: string) => string`\n\n- Details:\n\n  A function for formatting headings.\n\n### level\n\n- Type: `number[]`\n\n- Default: `[2, 3]`\n\n- Details:\n\n  Heading level that going to be included in the TOC.\n\n  When using this plugin with [markdown-it-anchor](https://github.com/valeriangalliat/markdown-it-anchor) (recommended), this option should be a subset of markdown-it-anchor's `level` option to ensure the target links are existed.\n\n### shouldAllowNested\n\n- Type: `boolean`\n\n- Default: `false`\n\n- Details:\n\n  Should allow headers inside nested blocks or not.\n\n  If set to `true`, headers inside blockquote, list, etc. would also be included.\n\n### containerTag\n\n- Type: `string`\n\n- Default: `'nav'`\n\n- Details:\n\n  HTML tag of the TOC container.\n\n### containerClass\n\n- Type: `string`\n\n- Default: `'table-of-contents'`\n\n- Details:\n\n  The class for the TOC container.\n\n### listTag\n\n- Type: `'ul' | 'ol'`\n\n- Default: `'ul'`\n\n- Details:\n\n  HTML tag of the TOC list.\n\n### listClass\n\n- Type: `string`\n\n- Default: `''`\n\n- Details:\n\n  The class for the TOC list.\n\n### itemClass\n\n- Type: `string`\n\n- Default: `''`\n\n- Details:\n\n  The class for the `<li>` tag.\n\n### linkTag\n\n- Type: `'a' | 'router-link'`\n\n- Default: `'a'`\n\n- Details:\n\n  The tag of the link inside the `<li>` tag.\n\n  You can set this option to render to links as [vue-router's router-link](https://router.vuejs.org/guide/#html).\n\n### linkClass\n\n- Type: `string`\n\n- Default: `''`\n\n- Details:\n\n  The class for the link inside the `<li>` tag.\n","publish_time":1794239012233,"_cnpm_publish_time":1794239012233,"dist-tags":{"latest":"4.0.0"}}