mdrender

1.0.2 • Public • Published

mdrender

Render a markdown file with optional JSON frontmatter.

Example

Rendering this file (file.md):

{{{
  "layout": "article",
  "tags": ["some", "nice", "tags"]
}}}
 
My Article
 
It's great.

Use mdrender, passing the path and a callback.

var mdrender = require('mdrender');
 
mdrender('/path/to/file.md', function (err, data) {
  . . .
});

Data looks like:

{
  title: "My Article",
  layout: "article",
  attributes: {
    tags: ["some", "nice", "tags"]
  },
  html: "<h1>My Article</h1>\n<p>It's great.</p>",
  markdown: "# My Article\n\nIt's great."
}

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i mdrender

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • tgvashworth