{"name":"@mdit-vue/plugin-frontmatter","version":"0.12.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.12.0","@types/markdown-it":"^12.2.3","gray-matter":"^4.0.3","markdown-it":"^13.0.1"},"publishConfig":{"access":"public"},"gitHead":"986b6023d3460cadefd409cd5d4b6445af3a05bd","_id":"@mdit-vue/plugin-frontmatter@0.12.0","_nodeVersion":"18.13.0","_npmVersion":"lerna/1.15.1/node@v18.13.0+arm64 (darwin)","dist":{"integrity":"sha512-26Y3JktjGgNoCVH7NLqi5RcdAauAqxepTt2qXueRcRHtGpiRQV2/M1FveIhCOTCtHSuG5bBOHUxGaV6vRK3Vbw==","shasum":"fb344646241bed1bae5f8bd320c7b2f493bd8b67","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-frontmatter/download/@mdit-vue/plugin-frontmatter-0.12.0.tgz","fileCount":6,"unpackedSize":7222,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/jXwYdCs9WTmuc/sh07BAXZ5X4aU+KFjEzvzy96o1GgIgIX14ql2EX3qgtHT79S0c1yfIacDT75HCTzgkW9WC/qE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5cXUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwFQ/6A5cPopJJPL38d76V5DTe+ooysRedEAT1SOsLjYCuiPQk/ZC1\r\n2eljECUmGlWnIB7UWj7ptzI2ESBggl/x/4OiEcf8Ba03Fi7MJSrdLUdQJREn\r\nopDMQMBJlnOUQkcJYId95FQjnz3KS10hqj1Ow1JSSB3vIbERFqjRy0leQBI9\r\nDRdRjiH20ZPIFyhDV8TDzh3EMPXQiBYbxjijnCTuIvL7LZ3uUkLnPsVu6wRQ\r\nvnhzXi81bw5VAhAhQI7wFuTuUKg3NFCgtq8XMfoCmBPLf/XsMYlSJSR7ZhGC\r\nVc7wvc3DKN3cYoKj9OERZ6jAkfXgdhjUg4aqM5tw3MVgYPV4x6M7wfi+CzN5\r\nNmWOWld8VXcwwZC9WsQz/kqqX1AzjtKSrQ3eOLeAaPp6mslO+K53PGsiy2Kp\r\n9Y92BsU3jhOiI6Nv2HXU32Sp2M7mM1M2FfP2+wGwLqlhDGBXYvdpx3HdHPbu\r\nZGBNH0CjcdMOEq7I/sOKu4lUYyIHSOKrVvs1uSDlLvgHAWp14XaRgeCLH+gP\r\nexA8seZq1s4LsdPaQUtoazNYD+6+T/g5pRE2rPKG5QJACA+gBtm6BhAC5FXL\r\n7yBqw22+IUdCshEGc6AQeH5P8KMSUg6HzuElwzCBYLiXcleAXscPRAAtXStC\r\nrD2WHGihfLgFVVev4eIK39HnRuFQg0C9vNQ=\r\n=aCOZ\r\n-----END PGP SIGNATURE-----\r\n","size":2699,"noattachment":false,"key":"/@mdit-vue/plugin-frontmatter/-/@mdit-vue/plugin-frontmatter-0.12.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.12.0_1676002771941_0.31747721140136176"},"_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":1676002772127,"_cnpm_publish_time":1676002772127,"dist-tags":{"latest":"4.0.0"}}