remark-retext
remark plugin to transform to retext
Last updated 3 months ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install remark-retext 
SYNC missed versions from official npm registry.

remark-retext

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to bridge or mutate to retext.

Install

npm:

npm install remark-retext

Use

Say we have the following file, example.md:

## Hello guys!

And our script, example.js, looks as follows:

var vfile = require('to-vfile')
var report = require('vfile-reporter')
var unified = require('unified')
var parse = require('remark-parse')
var stringify = require('remark-stringify')
var remark2retext = require('remark-retext')
var english = require('retext-english')
var equality = require('retext-equality')

unified()
  .use(parse)
  .use(
    remark2retext,
    unified()
      .use(english)
      .use(equality)
  )
  .use(stringify)
  .process(vfile.readSync('example.md'), function(err, file) {
    console.error(report(err || file))
  })

Now, running node example yields:

example.md
  1:10-1:14  warning  `guys` may be insensitive, use `people`, `persons`, `folks` instead  gals-men  retext-equality

⚠ 1 warning

API

origin.use(remark2retext, destination[, options])

remark (mdast) plugin to bridge or mutate to retext (nlcst).

destination

destination is either a parser or a processor.

If a Unified processor is given, runs the destination processor with the new nlcst tree, then, after running discards that tree and continues on running the origin processor with the original tree (bridge mode).

If a parser (such as parse-latin, parse-english, or parse-dutch) is given, passes the tree to further plugins (mutate mode).

options

Passed to mdast-util-to-nlcst.

Security

Use of remark-retext does not involve rehype (hast) or user content so there are no openings for cross-site scripting (XSS) attacks.

Related

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Current Tags

  • 4.0.0                                ...           latest (3 months ago)

10 Versions

  • 4.0.0                                ...           3 months ago
  • 3.1.3                                ...           a year ago
  • 3.1.2                                ...           2 years ago
  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
Maintainers (2)
Downloads
Today 6
This Week 378
This Month 214
Last Day 123
Last Week 432
Last Month 2,147
Dependencies (1)
Dev Dependencies (13)

Copyright 2014 - 2016 © taobao.org |