Spirit Markdown
Summary
A markdown parser middleware for the Spirit Core static file generator.
Installation
Install it from npm
npm install spirit-markdown
Syntax
To use simply add an optional markdown config object to the Spirit Core configuration.
And pass it to the Spirit Core use
method.
Example
Directory Structure
> = Directory
- = File
> "example"
- "_config.json"
> "src"
> "markdown"
- "example_post.md"
> "dest"
In _config.json
{
src : "src",
dest: "dest",
markdown : {
src : "markdown",
dest: "posts"
}
}
Then simply run the middleware.
var SpiritCore = require( 'spirit-core' ) ;
var spiritMarkdown = require( 'spirit-markdown' ) ;
var spirit = new SpiritCore( './example' ) ;
spirit.use( spiritMarkdown ) ;
spirit.run( ) ;
The output will then look like this.
> "example"
- "_config.json"
> "src"
> "markdown"
- "example_post.md"
> "dest"
>"posts"
-"example_post.html"
Configuration
The middleware take two configuration options
spiritConfig.markdown.src String
A string path relative to the source directory to specify where the middleware should look for markdown files.
spiritConfig.markdown.dest String
A string path relative to the destination directory to specify where the middleware should write the parsed markdown files.
The markdown is parsed using the Markdown-js markdown parser.
For more information visit the Spirit Core repository.
Hand made in San Francisco California by Alex Ray .