{"_id":"@mdit-vue/plugin-frontmatter@4.0.0","bugs":{"url":"https://github.com/mdit-vue/mdit-vue/issues"},"dist":{"shasum":"e61a80f35368dc5d3ad3aa67fdcd8634113549b4","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-frontmatter/download/@mdit-vue/plugin-frontmatter-4.0.0.tgz","fileCount":5,"integrity":"sha512-zCkwn5CiXN4gXSF2Ggfo2I9J+b0cnu9i3y4w8oFWvhvfW8UXIjCsfQnLeYTuYVaFeLeMEp3sII377VfEt73u/g==","signatures":[{"sig":"MEQCICS35mz73UoFhdKEHg8RgZG6EIw5bEfiVrj3vh8BNErcAiAadfkacLaM060MgnSZnU0j05q2ALyCgE54rYAGN4sOpg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGvQgW/5lhs/69v7GtaRF5RZCFhqReX/5Ypvcti5bjsCAiEA7qccbELvwC7NmdhyWLoDoLjfontAblsNHQ0CAlhevKk="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mdit-vue%2fplugin-frontmatter@4.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":6006,"size":2590,"noattachment":false,"key":"/@mdit-vue/plugin-frontmatter/-/@mdit-vue/plugin-frontmatter-4.0.0.tgz"},"name":"@mdit-vue/plugin-frontmatter","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":"961e85cd-4cd6-4a44-9ff6-f34c70d3180e"}},"homepage":"https://github.com/mdit-vue","keywords":["excerpt","frontmatter","markdown-it","markdown-it-plugin","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 get markdown frontmatter","directories":{},"maintainers":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com"}],"_nodeVersion":"26.13.0","dependencies":{"gray-matter":"^4.0.3","markdown-it":"^15.0.3","@mdit-vue/types":"4.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.23.7","vitest":"^5.1.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-frontmatter_4.0.0_1794239088909_0.9245395652189817"},"readme":"# @mdit-vue/plugin-frontmatter\n\n[![npm](https://badgen.net/npm/v/@mdit-vue/plugin-frontmatter)](https://www.npmjs.com/package/@mdit-vue/plugin-frontmatter)\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 get markdown frontmatter with [gray-matter](https://github.com/jonschlinkert/gray-matter).\n\n- Extracts frontmatter into markdown-it `env.frontmatter`.\n- Allows providing default frontmatter via markdown-it `env.frontmatter`.\n- Extracts markdown content without frontmatter into markdown-it `env.content`.\n- Supports extracting rendered excerpt into markdown-it `env.excerpt`.\n\n## Install\n\n```sh\nnpm i @mdit-vue/plugin-frontmatter\n```\n\n## Usage\n\n```ts\nimport { frontmatterPlugin } from '@mdit-vue/plugin-frontmatter';\nimport type { Env } from 'markdown-it';\nimport MarkdownIt from 'markdown-it';\n\nconst md = MarkdownIt({ html: true }).use(frontmatterPlugin, {\n  // options\n  grayMatterOptions: {\n    excerpt: true,\n    excerpt_separator: '<!-- more -->',\n  },\n});\nconst env: Env = {};\n\nconst rendered = md.render(\n  `\\\n---\ntitle: foobar\n---\n\nEverything above **more** comment will be extracted as excerpt.\n\n<!-- more -->\n\nThings below **more** comment will not be included in the excerpt.\n`,\n  env,\n);\n\nconsole.log(env.frontmatter);\nconsole.log(env.content);\nconsole.log(env.excerpt);\n```\n\n## Options\n\n### grayMatterOptions\n\n- Type: `GrayMatterOptions`\n\n- Details:\n\n  Options of [gray-matter](https://github.com/jonschlinkert/gray-matter).\n\n### renderExcerpt\n\n- Type: `boolean`\n\n- Default: `true`\n\n  Render the [excerpt](https://github.com/jonschlinkert/gray-matter#optionsexcerpt) with markdown-it or not.\n\n  This option will only take effects when `grayMatterOptions.excerpt` is enabled (disabled by default) or `grayMatterOptions.excerpt_separator` is set (undefined by default).\n","publish_time":1794239089008,"_cnpm_publish_time":1794239089008,"dist-tags":{"latest":"4.0.0"}}