{"name":"@mdit-vue/plugin-toc","version":"0.11.2","description":"A markdown-it plugin to generate table-of-contents that compatible with Vue.js","keywords":["markdown-it","markdown-it-plugin","vue","toc","table-of-contents"],"homepage":"https://github.com/mdit-vue","bugs":{"url":"https://github.com/mdit-vue/mdit-vue/issues"},"repository":{"type":"git","url":"git+https://github.com/mdit-vue/mdit-vue.git"},"license":"MIT","author":{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build":"unbuild","test":"vitest"},"dependencies":{"@mdit-vue/shared":"0.11.2","@mdit-vue/types":"0.11.0","@types/markdown-it":"^12.2.3","markdown-it":"^13.0.1"},"devDependencies":{"markdown-it-anchor":"^8.6.6"},"publishConfig":{"access":"public"},"gitHead":"676ec4ca8704d709e7a47f7f6d41ff3f70dc2356","_id":"@mdit-vue/plugin-toc@0.11.2","_nodeVersion":"16.18.0","_npmVersion":"lerna/1.13.0/node@v16.18.0+arm64 (darwin)","dist":{"integrity":"sha512-0OcGG4TnYIZJ6SLZtk24Nj0oP2vcLn0FyMTao/nB/2Z17/fP3whoo6dVV+0G4Oi8HZ+MMDi661lvS2b4b/glYA==","shasum":"ed508ec23fd7ea2b6a7263ac4c1b98a4bbdc0853","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-toc/download/@mdit-vue/plugin-toc-0.11.2.tgz","fileCount":6,"unpackedSize":14135,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiHQMP4PYI2HKOJBRlZZyACve7Fxh/AG9PS4wtMzHBoAIgfoifXw4Fd4+cAkXKRaY4SWkTkFKJA7CV+iBy7NSSnC8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpQjeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCiQ/9HMzlKpQ7pGrmyBVL+4j7g3pE91waPZSfBB8Na1wen/BtrabS\r\nAkUqE/OET/N5/UO1iIcHUn5fe9YpTLmGpkU04sEMOtNCUfpWoB8U7iYE9lCX\r\nO66QSaPJahTE1C8927gr+fwn/t2PK6XjvYOAKHTvMVIoMLDYssEMdI1ohEQw\r\nE1odI9FCsSPXZU1ex7jTOiwG+JPH81/EpMOq4YGm0L2lWY2zvKax8W0sOvyR\r\nWrYfOUGpEAEi6AClQtcCManQEpSCGxyWPGV74gSpZbgKRJLiGL2w3iZRh61H\r\nSM7u1DV91/nEQUnN89CusJIX/Q9e/70Ya0lf9yu0pn24JnOuYNAzMp9zh4b2\r\nFIoG3tdoR35SVweVMQpUUjZB1kcqcHP0NeEZk/rnkxOou6niODgyotXv6sJ6\r\nFqvIaKc8FRfwNBSKKSTtwENP/ovi3zQlYW47kJDH8T8YFnjrsYvcFMPYAOHD\r\nmelaDhUxFyTjSmhuqSwm0wSpxeVUvWkwLUY/csFOxxdWq+MuVAja2lbRoPx/\r\nYyeiACqUr/htR8YZsIF3PlP3XdgxMQy5nidtWsk+BBEyqolXk+MZ7OMMl9Cz\r\ngpDn8rn3aDhWD2eO17MLac1fD/KeUiF4DthII80Gf47QSVyZ0bqu4BrWEYW+\r\nsH9RlJaAQVAU6f4ySA4dOEY6ChwlM26/wA4=\r\n=NLEn\r\n-----END PGP SIGNATURE-----\r\n","size":4018,"noattachment":false,"key":"/@mdit-vue/plugin-toc/-/@mdit-vue/plugin-toc-0.11.2.tgz"},"_npmUser":{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"},"directories":{},"maintainers":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-toc_0.11.2_1671760093844_0.8208235823214534"},"_hasShrinkwrap":false,"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":1671760094051,"_cnpm_publish_time":1671760094051,"dist-tags":{"latest":"4.0.0"}}