Skip to content
Express middleware which parses your project root's README.md to HTML and exposes on a specified URL.
JavaScript
Latest commit f1996a8 Nov 26, 2013 @lloydwatkin Merge pull request #1 from bitdeli-chef/master
Add a Bitdeli Badge to README

README.md

express-middleware-readme.md

Express middleware which parses your project root's README.md to HTML and exposes on a specified URL.

Build Status

Usage

Default Options

app.use(require('express-middleware-readme.md').run)

This will expose your README.md at the the path '/readme.md'.

Set options

var readme = require('express-middleware-readme.md')
readme.setOptions({
    endpoint: [ '/readme.md', '/README.html' ],
    htmlWrap: {
        scripts: '/js/main.js',
        styles: '/css/style.css',
        meta: [
            { charset: 'utf-8' }
        ],
        title: 'This is my github README.md'
    }
})
app.use(readme.run)

Notes:

  • Each of 'endpoint', 'scripts', and 'styles' can be string values or arrays
  • An empty object as 'htmlWrap' results in just doctype, html, head, and body tags added
  • 'meta' can be made up of 'content', 'charset', 'http-equiv', and 'name' attributes
  • 'filename' is the location of your README.md relative to project root (defaults to ./README.md)
  • 'endpoint' defaults to '/readme.html'

License

Apache 2.0, please let me know if this doesn't suit :-)

To-do

Add tests, all code is crap without.

This will be a good little project for me to translate my unit testing skills over to node.js/javascript.

Bitdeli Badge

Something went wrong with that request. Please try again.