JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q24116F

Grunt plugin for building HTML docs with markdown

Package Exports

  • grunt-docs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (grunt-docs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

grunt-docs

A grunt plugin to build HTML docs from markdown files.

Uses YamYam to convert markdown and jade for layouts.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-docs

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-docs');

Documentation

This plugin provides the task: docs. Here is an example config block:

docs: {
  html: {
    layout: 'docs/api/layout.jade',
    src: ['docs/api/*.md'],
    dest: 'docs/index.html'
  }
}

This will compile all the markdown files (without a _ prepended) from the docs/api/ folder. Then use layout.jade to construct the final docs/index.html. If no layout is specified then all the compiled markdown files will joined with a newline.

You can also have each file be generated independently by setting dest as such: dest: 'docs/*'. The * is important.

Layout

The var blocks will be passed to the layout. It is an array of converted block objects: {data:'html here', file:'filepath'}. An example jade layout would be:

!!! 5
html
  body
    p Docs!
    ul
      each block in blocks
        //file:
          = block.file
        li!= block.data

Contributing

Please use the issue tracker and pull requests.

Future Plans

  • Allow other templating langs
  • Hooks for userland formatting
  • JSON output

Release History

  • 0.1.0 Initial release

License

Copyright (c) 2012 Kyle Robinson Young

Licensed under the MIT license.