node package manager

rehype-stringify

rehype-stringify Build Status Coverage Status Chat

Compiler for unified. Stringifies an HAST syntax tree to HTML. Used in the rehype processor.

Installation

npm:

npm install rehype-stringify

Usage

var unified = require('unified');
var createStream = require('unified-stream');
var parse = require('rehype-parse');
var stringify = require('rehype-stringify');
 
var processor = unified()
  .use(parse)
  .use(stringify, {
    quoteSmart: true,
    closeSelfClosing: true,
    omitOptionalTags: true,
    entities: {useShortestReferences: true}
  })
 
 
process.stdin
  .pipe(createStream(processor))
  .pipe(process.stdout);

API

processor.use(stringify[, options])

Configure the processor to stringify hast syntax trees to HTML.

options

Options can be passed when using processor.use(stringify, options). All settings are passed to hast-util-to-html.

License

MIT © Titus Wormer