parcel-plugin-md-fm

0.8.0 • Public • Published

parcel-plugin-md-fm

Parcel plugin for loading markdown with parsed frontmatter.

Install

With npm:

npm install parcel-plugin-md-fm --save-dev

With yarn:

yarn add --dev parcel-plugin-md-fm

Use

Importing:

import { content, data } from "./file.md";

If you get errors or red underlines in editors, add a markdown.d.ts file containing:

declare module "*.md" {
  const content: string;
  const data: object;
}

Test

Tests not implemented yet.

About

This uses the excellent gray-matter library under the hood which separates and then translates yaml or other frontmatter from a markdown file. See jonschlinkert/gray-matter for the exact result format.

Markdown is returned as a string (content) without further parsing so that you can use it with a parser/formatter of your choice like markdown-to-jsx (if you're using react).

Package Sidebar

Install

npm i parcel-plugin-md-fm

Weekly Downloads

0

Version

0.8.0

License

MIT

Unpacked Size

3.86 kB

Total Files

6

Last publish

Collaborators

  • umstek