{"name":"@mdit-vue/plugin-frontmatter","version":"0.11.0","description":"A markdown-it plugin to get markdown frontmatter","keywords":["markdown-it","markdown-it-plugin","vue","frontmatter","excerpt"],"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/types":"0.11.0","@types/markdown-it":"^12.2.3","gray-matter":"^4.0.3","markdown-it":"^13.0.1"},"publishConfig":{"access":"public"},"gitHead":"6e4f18dacc06e0aa5d3108df8925f6b0aa885150","_id":"@mdit-vue/plugin-frontmatter@0.11.0","_nodeVersion":"16.14.2","_npmVersion":"lerna/1.11.1/node@v16.14.2+x64 (linux)","dist":{"integrity":"sha512-Eo97g4QzL4ERxAY6UTF3KJ5i25KAZsJpnU9N2sNr8cHZYnk0FD23O2sAlYj/EU2MBi5NnhCsN/k9YfAhJGJ3cQ==","shasum":"cb7240b40fcd40a09be7740bba9b519d54e5ea39","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-frontmatter/download/@mdit-vue/plugin-frontmatter-0.11.0.tgz","fileCount":6,"unpackedSize":6911,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAYurpWKPShJ2eMMWqJwi2+pQtFht+S0mGTQXFJTR/5qAiEAzi9GXrkOAiM3TP1u/xozbevVTv7vtjiGcXp3x0kLpXE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB4o0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqo5Q/+MlU7vPJBBMEeZaHSFIw4wvpta/u1Va4sWHJ0+iTY+yeEIDIW\r\nTvFYzds3pZFp8nQMpPt8AnDP6UBrheG9kNy/DkucgQWvoyOPMPHvFSU4iFEf\r\ntBFCCDHKhypXc71l6Fb1z7OUuANJF6Nc0LUWYIxITC9mpOm6XirT0ZUvRYA9\r\n6ISHY5du7NA91G7uhcKtu8aVxBT6F0rjbVDYcOk7tPNZ+J8kgRC+MEdDUBGx\r\n+ivopvR6fOpqUNZpwMxNCDzlidkXgQ3Gf2JQ6mUjDt1eVN0fLCOZACBu9ftK\r\nNZJk+OU9YbIx1PVcQ/Ihb2ZAIyS0pmQtrHXoUTh14GRviY6rIeh3m4sLz5g2\r\n2abqJQTnq6aMNA/9R7AHANkeG/waeRPoHMCZaUGr4Tfb3OIdsSXsgzg9v76m\r\nVt49L1jyaVqIO1aqy8aRDRoJ5+qkPJ+DVCFq/YSifOdSYf43xxz9DwW6csIb\r\nI8/bv3Uz+V8lXf1zUoMe83xIkNOJ9SMHAjKNUvElwa66MvHik1COP3dGfzXQ\r\nw7hn6nqzbciXfDFbysYBWQEMLdxdIqYv25aZu5SNtSxYQct9s1H4VnEgQu35\r\noqlDM/4CBb5RHFZlb+h5rIifIOm8I7UJKigLFY3p/GvoxOGsKosEz9Cn3/+Z\r\n4tpPzlSH3l19/xYu1mfap/RGXExUHCYSJik=\r\n=nyZ1\r\n-----END PGP SIGNATURE-----\r\n","size":2714,"noattachment":false,"key":"/@mdit-vue/plugin-frontmatter/-/@mdit-vue/plugin-frontmatter-0.11.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-frontmatter_0.11.0_1661438516232_0.5990850188144621"},"_hasShrinkwrap":false,"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 { MarkdownItEnv } from '@mdit-vue/types';\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: MarkdownItEnv = {};\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":1661438516404,"_cnpm_publish_time":1661438516404,"dist-tags":{"latest":"4.0.0"}}