{"name":"@mdit-vue/plugin-frontmatter","version":"0.8.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.8.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.18.1"},"publishConfig":{"access":"public"},"gitHead":"7fd357a18b8bcc347cf17e2e78da3b3ed4242e58","_id":"@mdit-vue/plugin-frontmatter@0.8.0","_nodeVersion":"16.15.1","_npmVersion":"lerna/1.8.0/node@v16.15.1+x64 (linux)","dist":{"integrity":"sha512-STjTlQ+gxLBprcdyu2dH8kezgBwqS/jlPKLsy18BMSHoElGJeDJM458lwDa3MGL+Mm+g5NK0KoWTnQHj/9Uwow==","shasum":"2a794c2bebedcfe1526a8f91608175a5911c9d7b","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-frontmatter/download/@mdit-vue/plugin-frontmatter-0.8.0.tgz","fileCount":6,"unpackedSize":6905,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDp/xNxTp9YuJh+kD1gtaTVhy84ODMsjd6ZiQP+YMAWtgIgRuBLNm7pmudeJuWLUUJYWZvUlaWlMUXGDxYUv35CfGg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2it8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSiw//TunBbo251k4paQusPvT5gI1w8gK++MastTmNYS4YonxuXxih\r\nOdswDBXNDUxqxLfavGjqEe7TxvQIAXFHchfuNH0XddPUdUD7NmpjKrYSBON1\r\nzW3xmZHfo6G3k+wws1fCjGIiZLba4cdyy/GS9kTcu+GtRyEAGKPDMR2MsXyY\r\nqk8bNPS0ZPUBPMlrmbP3ek3y659OmGi8SIhJWR0fuZySsuafzmGWmKPQjtdK\r\newJp00HZzP6o+TjwCt2+/U7T7qD1MkW4x7326lTOIWkc9bNBsEM5JUmivOWp\r\n2erKwQpP17l9HRIDYKJ3jgXX0U8e+xKOxzYpIvQFQm1l1AWfMIGKzEcTmU3b\r\nZ1ElACzjfW7Y0v6huArKDaxWNkp6eSrhc6gZKn1MlHfXI3icqtldC+FhJmY/\r\nWjp33otaiXD/BFXxCR69HmBPiRoyLxgonl/cbtEh2ZjyeC/iAxCZxHx+BAzo\r\nTVTPurc10iWg4heTEr8cCuHuJTZIQwv2AXJYrBGK4gQ4u7NlUFabggv2ITby\r\ncfUayC58M/SD2HTcC+pgcOEeaEX4Kqx3GkhiIcfmDgz+kjTUQF62zIXLELBp\r\nF2Zl4MORqqGtv5EH/9n9p1s1n9gNNbA1xogy46+1/jF9JQZozyH8ZGNR3/s9\r\nSZqAK7GPEJ5kZLwlPcZKcBRaLkTPnzPUPvo=\r\n=zPqC\r\n-----END PGP SIGNATURE-----\r\n","size":2712,"noattachment":false,"key":"/@mdit-vue/plugin-frontmatter/-/@mdit-vue/plugin-frontmatter-0.8.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.8.0_1658465148550_0.21563335503160141"},"_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":1658465148775,"_cnpm_publish_time":1658465148775,"dist-tags":{"latest":"4.0.0"}}