{"name":"@mdit-vue/plugin-frontmatter","version":"0.9.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.9.0","@types/markdown-it":"^12.2.3","gray-matter":"^4.0.3","markdown-it":"^13.0.1"},"devDependencies":{"c8":"^7.12.0","unbuild":"^0.7.6","vitest":"^0.19.1"},"publishConfig":{"access":"public"},"gitHead":"4279fc7ac1db0b585ffb395f55a07038af2a7263","_id":"@mdit-vue/plugin-frontmatter@0.9.0","_nodeVersion":"16.15.1","_npmVersion":"lerna/1.8.0/node@v16.15.1+x64 (linux)","dist":{"integrity":"sha512-GT/UpW2kCGy4rfKU4oSBK+FqjHFxxo3R6+F0DFXjDDEJD7+O2kFF+bR164uZx/SRou2bGdKhZgNe8D+ZkcqqGw==","shasum":"b85fe78d6720e79c3976536176bcc581502451d6","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-frontmatter/download/@mdit-vue/plugin-frontmatter-0.9.0.tgz","fileCount":6,"unpackedSize":7007,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOyRVn+6WqW94Xq/1c3+D4l1AkSouJ/Xu7tA9b9IFuSgIhAIOUGRuxI3qGzd5nibsXVCrXPTkuT1lHHyL2diF+SYq8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi38mtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGsA//aU56OKu2s4R1k//djyCB+fXwMS5AyQHL7S26p93GWsAD3Ncf\r\nM6FsrNb7uEjimwqpMAMaFQwiMl5Ku3CnArsX4oUInD28cwKmUxxYNt073x0B\r\nenjZQuq+S316s6RaD518lizb3eOU5bJebpetmP5q6fyxJ5w4RMXzMCB3Nf9q\r\nAPV3NjnoqPwgXZZJYtjyxrTyqyuP3hYqy9B3K0mnBdUJwMRR3DKxhOFbUdME\r\n0v4ueetMVMCbJX6xDFUKXX8fHzOwOC/+qGI6Q2PCqwnOY5TIsw+W2pGAvHiW\r\nrlJJPuB0ESy9Gdo81BgDS88IZ8894C57gH6CqmG5Z/a/lbAyzXeRln1M3mMQ\r\n2ppi1atWxQNX4w5LJ2wyUiUZkyQxFUEOh+glyJHqqeEy4NgmgaFNBHdEim5v\r\nAIvdtLPYllcANF5MENHla9Tg24288rE7iVjXXf+fsYk0khSrJLhtD3wr8gxC\r\nisLJjn5bCgyUMSM80zwiED+nU6y4458lVRHCzFIFKE19sJ5SFzSNIUwV4ZO5\r\nbFv782wJ+bIz76eRBhJFJnRpK3Z4vMn6KBTrxgFnog5i36gSjgqBPs2kp9Xa\r\nHeo4p+J9gnnA9YEAKK99ktPwjW/+XP/IRPqyiJaKN/qqpQxJEeh+PVsV2eQl\r\nJCofzi9f7BW6feUPmFbiL4z34OHKh3MLwDo=\r\n=DBSD\r\n-----END PGP SIGNATURE-----\r\n","size":2749,"noattachment":false,"key":"/@mdit-vue/plugin-frontmatter/-/@mdit-vue/plugin-frontmatter-0.9.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.9.0_1658833325476_0.5462085435839339"},"_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":1658833325676,"_cnpm_publish_time":1658833325676,"dist-tags":{"latest":"4.0.0"}}