mdast-util-to-nlcst
![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/mdast-util-to-nlcst.svg)
mdast utility to transform markdown
into nlcst, while keeping location
information intact.
In plain English: this enables natural-language tooling to read markdown as
input.
Note You probably want to use
remark-retext.
Installation
npm:
npm install mdast-util-to-nlcst
mdast-util-to-nlcst is also available for duo,
and as an AMD, CommonJS, and globals module,
uncompressed and compressed.
Usage
var toNLCST = require('mdast-util-to-nlcst');
var inspect = require('unist-util-inspect');
var remark = require('remark');
var retext = require('retext');
remark().process('Some *foo*s-_ball_.', function (err, file) {
var tree = toNLCST(file, retext().Parser);
console.log(inspect(tree));
});
API
toNLCST(file, Parser | parser)
Transform a by remark processed
virtual file into an
NLCST tree for
retext.
Parameters:
Returns:
NLCSTNode
.
License
MIT © Titus Wormer