Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remark-retext

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-retext

retext support for remark

  • 3.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80K
decreased by-17.71%
Maintainers
1
Weekly downloads
 
Created
Source

remark-retext Build Status Coverage Status

Bridge / mutate from remark to retext.

Installation

npm:

npm install remark-retext

Usage

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)

Either bridge or mutate from remark (MDAST) 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 plug-ins (mutate-mode).

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 17 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc