Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
__tests__
src
LICENSE
README.md
package-lock.json
package.json
prettier.config.js

README.md

rollup-plugin-markdown

CircleCI

A Rollup plugin to parse Markdown files.

  • Showdown is used to parse the Markdown
  • Gray Matter is used to parse front-matter from the markdown file.

Install

npm install --save-dev @jackfranklin/rollup-plugin-markdown

yarn add --dev @jackfranklin/rollup-plugin-markdown

Example module output

import blogPost from './blog-post.md'

// from this import you get:
blogPost.html // the parsed HTML
blogPost.metadata // a JS object of the front-matter
blogPost.filename // blog-post.md - the filename that was imported

Rollup configuration

import markdown from '@jackfranklin/rollup-plugin-markdown'

export default {
  input: 'your-app.js',
  plugins: [markdown()],
}

You can pass in two options: include and exclude, which are globs to limit which file(s) the plugin is applied to.

The plugin will only parse .md files.

You can’t perform that action at this time.