Comparing version 2.0.0 to 2.1.0
@@ -5,2 +5,8 @@ <!--mdast setext--> | ||
2.1.0 / 2015-10-10 | ||
================== | ||
* Add support for processor data ([e9b9f7e](https://github.com/wooorm/unified/commit/e9b9f7e)) | ||
* Add references to `hast` ([d1a1c7e](https://github.com/wooorm/unified/commit/d1a1c7e)) | ||
2.0.0 / 2015-09-16 | ||
@@ -7,0 +13,0 @@ ================== |
11
index.js
@@ -19,2 +19,3 @@ /** | ||
var ware = require('ware'); | ||
var extend = require('extend'); | ||
var AttachWare = require('attach-ware')(ware); | ||
@@ -55,2 +56,3 @@ var VFile = require('vfile'); | ||
var Compiler = options.Compiler; | ||
var data = options.data; | ||
@@ -75,2 +77,6 @@ /** | ||
self.Compiler = unherit(Compiler); | ||
if (self.data) { | ||
self.data = extend(true, {}, self.data); | ||
} | ||
} | ||
@@ -175,3 +181,3 @@ | ||
var CustomParser = (this && this.Parser) || Parser; | ||
var node = new CustomParser(file, settings).parse(); | ||
var node = new CustomParser(file, settings, instance(this)).parse(); | ||
@@ -223,3 +229,3 @@ file.namespace(name).tree = node; | ||
return new CustomCompiler(file, settings).compile(); | ||
return new CustomCompiler(file, settings, instance(this)).compile(); | ||
} | ||
@@ -276,2 +282,3 @@ | ||
Processor.process = proto.process = process; | ||
Processor.data = proto.data = data || null; | ||
@@ -278,0 +285,0 @@ return Processor; |
{ | ||
"name": "unified", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Text processing framework: Parse / Transform / Compile", | ||
@@ -12,2 +12,3 @@ "license": "MIT", | ||
"stringify", | ||
"hast", | ||
"retext", | ||
@@ -19,2 +20,3 @@ "mdast" | ||
"bail": "^1.0.0", | ||
"extend": "^3.0.0", | ||
"unherit": "^1.0.4", | ||
@@ -21,0 +23,0 @@ "vfile": "^1.0.0", |
@@ -6,4 +6,5 @@ # unified [![Build Status](https://img.shields.io/travis/wooorm/unified.svg)](https://travis-ci.org/wooorm/unified) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/unified.svg)](https://codecov.io/github/wooorm/unified) | ||
This library provides the boilerplate to make parsing and compiling pluggable. | ||
It’s in use by [**mdast**](https://github.com/wooorm/mdast) and | ||
[**retext**](https://github.com/wooorm/retext). | ||
It’s in use by [**mdast**](https://github.com/wooorm/mdast), | ||
[**retext**](https://github.com/wooorm/retext), and | ||
[**hast**](https://github.com/wooorm/hast). | ||
@@ -69,2 +70,4 @@ ## Installation | ||
* [Processor#data](#processordata) | ||
* [License](#license) | ||
@@ -82,7 +85,10 @@ | ||
* `data` (`Object`, optional) — `JSON.stringify`able dictionary providing | ||
information to `Parser`, `Compiler`, and plug-ins. | ||
* `Parser` (`Function`) — Constructor which transforms a virtual file | ||
into a syntax tree. When input is parsed, this function will be | ||
constructed with a `file` and `settings`. `Parser` instances should | ||
have a `parse` method which returns a `node` (an object with a `type` | ||
property). | ||
constructed with a `file`, `settings`, and the processor. `Parser` | ||
instances must have a `parse` method which returns a `node` (an object | ||
with a `type` property). | ||
@@ -94,4 +100,4 @@ The string representation of a file can be accessed by executing | ||
into a string. When input is compiled, this function will be | ||
constructed with a `file` and `settings`. `Compiler` instances should | ||
have a `compile` method which returns a `string`. | ||
constructed with a `file`, `settings`, and the processor. `Compiler` | ||
instances must have a `compile` method which returns a `string`. | ||
@@ -354,4 +360,11 @@ The syntax tree representation of a file can be accessed by executing | ||
### Processor#data | ||
`JSON.stringify`able dictionary providing information to `Parser`, `Compiler`, | ||
and plug-ins. Cloned when a `Processor` is constructed and to `processor.data`. | ||
**Type**: `Object`, optional. | ||
## License | ||
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21346
239
366
6
+ Addedextend@^3.0.0
+ Addedextend@3.0.2(transitive)