{"name":"@mdit-vue/plugin-toc","version":"0.6.0","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"},"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.6.0","@mdit-vue/types":"0.6.0","@types/markdown-it":"^12.2.3","markdown-it":"^13.0.1"},"devDependencies":{"c8":"^7.11.3","markdown-it-anchor":"^8.6.4","unbuild":"^0.7.4","vitest":"^0.18.0"},"publishConfig":{"access":"public"},"gitHead":"654a3a4d52f4fb9711bf5f7ba3674ff58ec663bf","_id":"@mdit-vue/plugin-toc@0.6.0","_nodeVersion":"16.14.2","_npmVersion":"lerna/1.6.0/node@v16.14.2+x64 (linux)","dist":{"integrity":"sha512-5pgKY2++3w2/9Pqpgz7mZUiXs6jDcEyFPcf14QdiqSZ2eL+4VLuupcoC4JIDF+mAFHt+TJCfhk3oeG8Y6s6TBg==","shasum":"acc46fc26c71b3aee4c1387ca2bb8e1aa8c023a1","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-toc/download/@mdit-vue/plugin-toc-0.6.0.tgz","fileCount":15,"unpackedSize":33214,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC/qCv99gx3nIDIvIlX0FWWS9sEP13gg8OTSYqLde/KQIhAOOQJRk6HdTeW9+UnMMu3luqQ7az0FAfXgfLHiGnTiXg"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizFfUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAoQ//b4TpDroU1Qfjvwi6I6eLR8GBge0sedvKB3QzalZerD+5VQmf\r\n/ERC1Iod0U0JlE+cxPQevT4SCmtMJHB70oBVEJZVIokAXXzzvQpASoL7jAQA\r\nFp0lez1++/6PU24HUM8N8Q2GLvXIj8zMacp9aWU6hvnHVjFgzU7mNomCnlvS\r\nnx8Vdl9w1r311SCalNE/6fBlOrDmSSatpEdEd6HK6cgjRrEGz3UAHRINnR+0\r\n3duNSpMeZo/W1A3luk6fFq2vBVbhxMNviypVbvlG+ZxOeiUs6t5pF6RSC/1X\r\nSIj6YGd2EWyz7XO8EdKhBsERMos4Im+pZH4sGgbxiCJ5xKTZedvKER7MuVtH\r\n/s0uEoMVvPNkHP6YTRJX8STBrvwzjT/KFtfLp58n2xrZC7jEG30MSyDqbhUb\r\n6lWklJOCKkbx2ypifPSYNAjtmE/CeE5u7h8DtPsj4NYKH3Sfp13lIrMlCROy\r\nh7VltE5Uw/VHzD2iriAWixmzYNw5bqXNTWY0aJVSY68X1G2RsJB/O4vg8Rhq\r\npjZbWgJI96iI6rHe1UN+1lkeVtDJm2orWSKNdnw60jDNZD9LWwCmMO8FhCOi\r\np5qQTn/XQxOv48LOnQeFxEjzgLHe/zAD0JsuGP/e9vJDKzOfZKKQDzGe+PGs\r\nN58I/+UJKJBTwLhOfqebgXCM7S/jID/suTM=\r\n=X3xl\r\n-----END PGP SIGNATURE-----\r\n","size":7515,"noattachment":false,"key":"/@mdit-vue/plugin-toc/-/@mdit-vue/plugin-toc-0.6.0.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.6.0_1657558995843_0.9729612551932973"},"_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":1657558996008,"_cnpm_publish_time":1657558996008,"dist-tags":{"latest":"4.0.0"}}