render-readme

render and sanitize readme.md just like github would

MIT 10 个版本
安装
npm install render-readme
yarn add render-readme
pnpm add render-readme
bun add render-readme
README

Render and sanitize readme.md just like github would.

Basically, it's node.js version for this: https://github.com/github/markup

But only for markdown for now, because that's what io.js packages use mostly.

API

require('render-readme')('Hello, *world*!')

// outputs '<p>Hello, <em>world</em>!</p>\n'

Features

  • the basic rendering is commonmark + gfm extensions (emphasis slightly differs, but nobody cares anyway)
  • html is sanitized, the configuration is similar to github stuff (using sanitize-html)
  • syntax highlighting (using highlight-js for this one)
  • YAML metadata on top of markdown documents is rendered to a table
  • anchors for headers (<a name="blah"> instead of <a id="user-content-blah">, but should be good enough)
版本列表
1.3.1 2015-07-11
1.3.0 2015-03-28
1.2.0 2015-02-27
1.1.0 2015-01-26
1.0.1 2014-12-28
1.0.0 2014-12-25
0.2.3 2014-12-21
0.2.2 2014-12-14
0.2.1 2014-12-01
0.2.0 2014-12-01