@enyaxu/rehype-stringify

3.0.1 • Public • Published

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

Package Sidebar

Install

npm i @enyaxu/rehype-stringify

Weekly Downloads

1

Version

3.0.1

License

MIT

Unpacked Size

3.08 kB

Total Files

4

Last publish

Collaborators

  • issuehunt