Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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
}

About

An Assemble plugin for automatic parsing of markdown in data.

Resources

License

Packages

No packages published