{"name":"@mdit-vue/plugin-frontmatter","version":"0.9.1","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":"8f7879b6a317cbae2f28d7f5cf563715387f7089","_id":"@mdit-vue/plugin-frontmatter@0.9.1","_nodeVersion":"16.15.1","_npmVersion":"lerna/1.8.0/node@v16.15.1+x64 (linux)","dist":{"integrity":"sha512-s5untW33DpE0j0w3z9h27qAzETlVKlzHzA0rrX6T17CRYfynAXb5H9XIH8XFJpWDCcdSyk5t2gPW2WNtwtmvnw==","shasum":"6f0a3cbf4602e1c25d0b594464f3d1d72ccf7c66","tarball":"http://registry-npm.ywwl.com/@mdit-vue/plugin-frontmatter/download/@mdit-vue/plugin-frontmatter-0.9.1.tgz","fileCount":6,"unpackedSize":7007,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBkKSIzFRzgASsAHfukX7/JZgcNVdNrzmZRZa6JtxTplAiBuxFkhEV4Nv+9Nw3BonSQiYLSiO40zOZ3dJ3Dxrstldg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi383kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBow/7BKhFl4zFrKJjnfj4GVUsos0Hse/BLlBTxLD/j9Q+IlFyK0Vb\r\nG8WGzNzdm80FvaK4suRbFbNKsnzU7yJME/mZ+uUtAD8T895dhRkmKLKk82GR\r\n8AAw1hB7HEL1/Tq6b9BBTnmMcMeRNzyG45TfF7S3U/B5HGuJFokXaZ0Uy1OS\r\nloeyGZiAGxUY5BLzx7jQI8crMhP4fZrBCnoC3Zx+oAbkBclt9NIyB/rDqbQO\r\n6owgUpFSnII4qLX/lXAPBiyCwbJTaRi/jfY/86IKsr4MCtwZTuGJTzoOU0Nx\r\nLs+VsBChgctrNBuR4ZUdHLiRRsXm4ykDCZs96tCmZB+y9KWQ//pFSNLw13LM\r\ndD/m3FaHsY64fi/uZSsMUE1kKbEgX+agWwTfceSjF1DNFFR/CZKszNdD374s\r\nphqrwKsVrYvrB8TzbpHGZlKpT4qDxhviMk1xuL0m7g29d61ileucahNSXH5Q\r\nlIYwYIrhLaAE/qIWdTCdXsjw6jAdKifM26VXP2QHvBQgPiykWgQS6Nh2XfHd\r\nkuSY94xmahTxa/qAGH8NLRMx2pI1QBzklpuNYB9pdYJvQR2tbbhSo5PNUXcz\r\n31/JB1a8vnV+Auf6gpuLjoQdEbuRA57Q75zGEyOqKPJY16PzqClvOGmmPpJz\r\noDzKu6UpLB4f2HTXcaV7kh4vQW5oTDnq1fQ=\r\n=Xk5X\r\n-----END PGP SIGNATURE-----\r\n","size":2753,"noattachment":false,"key":"/@mdit-vue/plugin-frontmatter/-/@mdit-vue/plugin-frontmatter-0.9.1.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.1_1658834403947_0.7934215342576436"},"_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":1658834404250,"_cnpm_publish_time":1658834404250,"dist-tags":{"latest":"4.0.0"}}