grunt-markade
v0.2.1
Published
A Markade build step for grunt
Downloads
5
Readme
grunt-markade
A Markade build step for grunt
Getting Started
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-markade --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-markade');
The "markade" task
Overview
In your project's Gruntfile, add a section named markade
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
markade: {
tem: {
options: {
"template": "template.jade"
},
files: {
'output.html': "data.md"
}
},
},
});
Options
options.template
Type: String
Default value: empty.jade
A file path to the Jade template. If none is specified it simply parses out all Markdown content.
options.jade
Type: Object
Default value: {}
An object with options to pass to Jade.compile
. Values like pretty: true
.
Usage Examples
Default Options
In this example, the default options are used to compile a Markade file.
So if file.md
has content **bold** text
then default.html
would be <b>bold</b> text
.
grunt.initConfig({
markade: {
no_template: {
options: {},
files: {
'dest/default.html': ["src/file.md"],
},
}
},
});
Template
Add a template
option to parse the data through the Jade template.
grunt.initConfig({
markade: {
layout: {
options: {
template: 'templates/layout.jade'
},
files: {
'index.html': 'index.md'
},
}
},
});
Directory
You can compile all files in a directory.
grunt.initConfig({
markade: {
options: {
template: 'templates/layout.jade'
},
files: {
'public': ['index.md', 'about.md', 'contact.md']
},
},
});
#### Jade Options
You can pass objects to Jade.
```js
grunt.initConfig({
markade: {
with_layout: {
options: {
"template": "templates/index.jade",
"jade": {
"pretty": true
}
},
files: {
"public/index.html": "data/index.md"
}
}
},
});
## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).