spirit-markdown
A markdown parser for the spirit static file generator.
Last updated 5 years ago by alexray .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install spirit-markdown 
SYNC missed versions from official npm registry.

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 .

Current Tags

  • 1.1.0                                ...           latest (5 years ago)

2 Versions

  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (1)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |