mdast-util-to-nlcst
Advanced tools
Comparing version 0.2.1 to 1.0.0
@@ -5,2 +5,7 @@ <!--mdast setext--> | ||
1.0.0 / 2015-09-18 | ||
================== | ||
* Refactor module ([0dd7eb9](https://github.com/wooorm/mdast-util-to-nlcst/commit/0dd7eb9)) | ||
0.2.1 / 2015-08-15 | ||
@@ -7,0 +12,0 @@ ================== |
29
index.js
@@ -12,2 +12,4 @@ /** | ||
/* eslint-env commonjs */ | ||
/* | ||
@@ -18,3 +20,2 @@ * Dependencies. | ||
var range = require('mdast-range'); | ||
var Latin = require('parse-latin'); | ||
var toString = require('nlcst-to-string'); | ||
@@ -219,4 +220,4 @@ | ||
* @param {File} file - Virtual file. | ||
* @param {Function?} [Parser] - Constructor of an nlcst | ||
* parser. Defaults to `ParseLatin`. | ||
* @param {Parser|Function} Parser - (Instance of) NLCST | ||
* parser. | ||
* @return {NLCSTNode} - NLCST. | ||
@@ -226,4 +227,4 @@ */ | ||
var ast; | ||
var space; | ||
var parser; | ||
var cst; | ||
@@ -238,3 +239,4 @@ /* | ||
ast = file.namespace('mdast').ast; | ||
space = file.namespace('mdast'); | ||
ast = space.tree || space.ast; | ||
@@ -259,13 +261,6 @@ if (!ast || !ast.type) { | ||
if (!Parser) { | ||
Parser = Latin; | ||
throw new Error('mdast-util-to-nlcst expected parser'); | ||
} | ||
if ('parse' in Parser) { | ||
parser = Parser; | ||
parser.position = true; | ||
} else { | ||
parser = new Parser({ | ||
'position': true | ||
}); | ||
} | ||
parser = 'parse' in Parser ? Parser : new Parser(); | ||
@@ -284,7 +279,3 @@ /* | ||
cst = parser.parse(one(ast, null, null, file, parser)); | ||
file.namespace('retext').cst = cst; | ||
return cst; | ||
return parser.parse(one(ast, null, null, file, parser)); | ||
} | ||
@@ -291,0 +282,0 @@ |
{ | ||
"name": "mdast-util-to-nlcst", | ||
"version": "0.2.1", | ||
"version": "1.0.0", | ||
"description": "Markdown to Natural Language", | ||
@@ -14,5 +14,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"mdast-range": "^0.4.3", | ||
"parse-latin": "^0.5.1", | ||
"nlcst-to-string": "^0.1.5" | ||
"mdast-range": "^1.0.0", | ||
"nlcst-to-string": "^1.0.0" | ||
}, | ||
@@ -39,10 +38,11 @@ "repository": { | ||
"mdast": "^1.0.0", | ||
"mdast-comment-config": "^0.1.2", | ||
"mdast-github": "^0.3.0", | ||
"mdast-lint": "^0.4.0", | ||
"mdast-slug": "^0.1.1", | ||
"mdast-validate-links": "^0.3.1", | ||
"mdast-comment-config": "^1.0.0", | ||
"mdast-github": "^1.0.0", | ||
"mdast-lint": "^1.0.0", | ||
"mdast-slug": "^2.0.0", | ||
"mdast-validate-links": "^1.0.0", | ||
"mocha": "^2.0.0", | ||
"parse-dutch": "^0.5.0", | ||
"parse-english": "^0.5.0", | ||
"parse-dutch": "^2.0.0", | ||
"parse-english": "^2.0.0", | ||
"parse-latin": "^2.0.0", | ||
"vfile": "^1.0.0" | ||
@@ -49,0 +49,0 @@ }, |
@@ -198,7 +198,8 @@ # mdast-util-to-nlcst [![Build Status](https://img.shields.io/travis/wooorm/mdast-util-to-nlcst.svg)](https://travis-ci.org/wooorm/mdast-util-to-nlcst) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/mdast-util-to-nlcst.svg)](https://codecov.io/github/wooorm/mdast-util-to-nlcst) | ||
### toNLCST(file\[, Parser | parser\]) | ||
### toNLCST(file, Parser | parser) | ||
Transform a by [**mdast**](https://github.com/wooorm/mdast) processed | ||
[**virtual file**](https://github.com/wooorm/vfile) into an file ready | ||
for processing by [**retext**](https://github.com/wooorm/retext). | ||
[**virtual file**](https://github.com/wooorm/vfile) into a | ||
[NLCST](https://github.com/wooorm/nlcst) tree for | ||
[**retext**](https://github.com/wooorm/retext). | ||
@@ -211,6 +212,6 @@ Parameters: | ||
* `parser` (`Function` or `Parser`, default: `new ParseLatin()`, optional) | ||
* `parser` (`Function` or `Parser`, optional) | ||
— You can pass the (constructor of) an NLCST parser, such as | ||
[**parse-english**](https://github.com/wooorm/parse-english) or | ||
[**parse-dutch**](https://github.com/wooorm/parse-dutch), the default is | ||
[**parse-english**](https://github.com/wooorm/parse-english), | ||
[**parse-dutch**](https://github.com/wooorm/parse-dutch), or | ||
[**parse-latin**](https://github.com/wooorm/parse-latin). | ||
@@ -217,0 +218,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
1
224
20337
17
231
+ Addedmdast-range@1.0.1(transitive)
+ Addednlcst-to-string@1.1.0(transitive)
+ Addedunist-util-is@3.0.0(transitive)
+ Addedunist-util-visit@1.4.1(transitive)
+ Addedunist-util-visit-parents@2.1.2(transitive)
- Removedparse-latin@^0.5.1
- Removedarray-iterate@0.1.0(transitive)
- Removedmdast-range@0.4.3(transitive)
- Removedmdast-util-visit@0.1.1(transitive)
- Removednlcst-to-string@0.1.5(transitive)
- Removedparse-latin@0.5.2(transitive)
Updatedmdast-range@^1.0.0
Updatednlcst-to-string@^1.0.0