assemble-markdown-data

0.0.4 • Public • Published

assemble-markdown-data

NPM version NPM dependencies

An Assemble plugin for automatic parsing of markdown in data.

Usage

First, setup a project with Grunt and Assemble.

Then install the plugin:

npm install --save-dev assemble-markdown-data

Add the plugin to your Grunt assemble config:

assemble: {
  options: {
    plugins: [ 'assemble-markdown-data' ]
  },
  // ...
},

For any data value you want to be parsed as markdown, define it as an object with markdown key whose value is a markdown string. Before rendering, this object will be replaced by the HTML that results from parsing the markdown.

Example

# profile.yml
name: Anders D. Johnson
about:
  markdown: |
    My favorite things to do are:
    * Writing code
      * Especially JavaScript
    * Browsing [GitHub](https://github.com)
age: 23

Resulting JavaScript object:

{
  "name": "Anders D. Johnson",
  "about": "<p>My favorite things to do are:</p><ul><li>Writing code<ul><li>Especially JavaScript</li></ul></li><li>Browsing <a href=\"https://github.com\">GitHub</a></li></ul>",
  "age": 23
}

/assemble-markdown-data/

    Package Sidebar

    Install

    npm i assemble-markdown-data

    Weekly Downloads

    8

    Version

    0.0.4

    License

    none

    Unpacked Size

    7.21 kB

    Total Files

    10

    Last publish

    Collaborators

    • adjohnson916