# grunt-strapdown
> grunt task for strapdown.js
## What Is This
This [grunt](http://gruntjs.com/) task does a very stupid thing: it takes a set of markdown files and **inserts** each of them into a html template, where [strapdown.js][strapdown.github] takes care of all the rest (the parsing and the styling).
For example, this markdown file `xxx.md`:
```markdown
# I Am So Hungry
I am so hungry i can eat an elephant.
```
will be converted into a `xxx.html`:
```html
a
# I Am So Hungry
I am so hungry i can eat an elephant.
×mp>
```
*(Something looks different about that `×mp>` closing tag, see FAQ below.)*
Drop this `xxx.html` into any static web server and open it from the browser, and [strapdown.js][strapdown.github] will parse and style the markdown text for you.
## Usage
Install this plugin:
```shell
npm install --save-dev grunt-markdown
```
Then enable it in your gruntfile, e.g.:
```coffeescript
# example gruntfile in coffeescript:
module.exports = (grunt)->
grunt.initConfig
strapdown:
default:
src: ['path/to/*.md']
dest: 'output_dir'
change_theme:
src: ['path/to/*.md']
dest: 'output_dir'
theme: 'slate'
custom_template:
src: ['path/to/*.md']
dest: 'output_dir'
options:
template: 'path/to/your/template.html'
templateData:
charset: 'utf8'
version: '1.0'
whatever: 'you want'
grunt.loadNpmTasks 'grunt-strapdown'
```
You can then run this task with `grunt strapdown`.
### Options
Follow the example gruntfile above, these are the options that the `strapdown` task accepts:
* `src`: required, pattern(s) to match markdown files.
* `dest`: required, the **directory** where generated html files will be stored in.
* `theme`: optional, defaults to 'cyborg'. See [here](https://github.com/arturadib/strapdown/tree/gh-pages/v/0.2/themes) for strapdown's bulitin themes and see [bootswatch][bootswatch] for more.
* `options.template`: optional, path to html template. Copy and modify grunt-strapdown's default template from [here][default-template] to make your own template.
* `options.templateData`: optional, data to be passed into the template. We use [lodash.template()][lodash.template].
## FAQ
1. **So what my markdown file didn't get parsed, it's just inserted right into the middle of a html template?**
Yes.
2. **And then when I open the html from the browser, that `