Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koajs/koa-markdown
Auto convert markdown to html for koa. Inspired by connect-markdown
https://github.com/koajs/koa-markdown
Last synced: 2 months ago
JSON representation
Auto convert markdown to html for koa. Inspired by connect-markdown
- Host: GitHub
- URL: https://github.com/koajs/koa-markdown
- Owner: koajs
- License: mit
- Created: 2014-02-22T10:41:55.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-03-31T16:17:55.000Z (9 months ago)
- Last Synced: 2024-04-14T13:08:40.301Z (8 months ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 36
- Watchers: 3
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
- awesome-koa - koa-markdown - Auto convert markdown to html for koa. Inspired by connect-markdown (Middleware)
README
koa-markdown
============[![Build Status](https://secure.travis-ci.org/koajs/koa-markdown.png)](http://travis-ci.org/koajs/koa-markdown)
Auto convert markdown to html for koa. Inspired by [connect-markdown](https://github.com/expressjs/connect-markdown).
Powered by [remarkable](https://github.com/jonschlinkert/remarkable).[![NPM](https://nodei.co/npm/koa-markdown.png?downloads=true)](https://nodei.co/npm/koa-markdown/)
## Usage
```js
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](https://github.com/koajs/koa-markdown/tree/master/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