mdast-util-to-nlcst
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 The interface is pretty rough. But in the future this will be built
into mdast/retext, something called “bridging”, so you won’t have to
use this library manually in the future :smile:!
Installation
npm:
npm install mdast-util-to-nlcst
mdast-util-to-nlcst is also available for bower,
component, and
duo, and as an AMD, CommonJS, and globals
module, uncompressed and
compressed.
Usage
var mdast = require('mdast');
var toNLCST = require('mdast-util-to-nlcst');
mdast.process('Some *foo*s-_ball_.', function (err, doc, file) {
toNLCST(file);
console.log(file.namespace('retext').cst);
});
API
toNLCST(file[, Parser | parser])
Transform a by mdast processed
virtual file into an file ready
for processing by retext.
Parameters:
Returns:
NLCSTNode
.
License
MIT © Titus Wormer