Skip to content

Auto convert markdown to html for koa. Inspired by connect-markdown

License

Notifications You must be signed in to change notification settings

koajs/koa-markdown

Repository files navigation

koa-markdown

Build Status

Auto convert markdown to html for koa. Inspired by connect-markdown. Powered by remarkable.

NPM

Usage

var koa = require('koa');
var markdown = require('koa-markdown');

var app = koa();
app.use(markdown({
  root: __dirname + '/docs',
  baseUrl: '/docs'
}));

app.listen(7001);

Or you can checkout the example.

Options

  • root: the markdown file root directory (required)
  • baseUrl: base url of koa-markdown (required)
  • layout: layout html file, default is root/layout.html
  • titleHolder: title place holder in layout.html, default is {TITLE}
  • bodyHolder: body place holder in layout.html, default is {BODY}
  • indexName: request base url will get indexName.md, default is 'index'
  • cache: cache the html page, default is false
  • render: custom render function, default is markdown-it.render
  • mdOptions: markdown-it options, by defualt, koa-markdown is using markdown-it as it's render.

Licences

MIT

About

Auto convert markdown to html for koa. Inspired by connect-markdown

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •