Comparing version 6.1.3 to 6.1.4
{ | ||
"name": "unified", | ||
"version": "6.1.3", | ||
"version": "6.1.4", | ||
"description": "Pluggable text processing interface", | ||
@@ -41,3 +41,3 @@ "license": "MIT", | ||
"remark-cli": "^3.0.0", | ||
"remark-preset-wooorm": "^2.0.0", | ||
"remark-preset-wooorm": "^3.0.0", | ||
"tape": "^4.4.0", | ||
@@ -76,4 +76,6 @@ "xo": "^0.18.1" | ||
"remarkConfig": { | ||
"plugins": ["preset-wooorm"] | ||
"plugins": [ | ||
"preset-wooorm" | ||
] | ||
} | ||
} |
183
readme.md
@@ -11,2 +11,6 @@ # ![unified][logo] | ||
[`unifiedjs.github.io`][site], the website for **unified** provides a less | ||
technical, more practical, introduction to unified. Make sure to visit it | ||
and try its introductionary [Guides][]. | ||
## Installation | ||
@@ -26,3 +30,3 @@ | ||
var remark2rehype = require('remark-rehype'); | ||
var document = require('rehype-document'); | ||
var doc = require('rehype-document'); | ||
var format = require('rehype-format'); | ||
@@ -35,3 +39,3 @@ var html = require('rehype-stringify'); | ||
.use(remark2rehype) | ||
.use(document) | ||
.use(doc) | ||
.use(format) | ||
@@ -133,5 +137,5 @@ .use(html) | ||
* [**rehype**][rehype] ([**HAST**][hast]) — HTML; | ||
* [**remark**][remark] ([**MDAST**][mdast]) — Markdown; | ||
* [**retext**][retext] ([**NLCST**][nlcst]) — Natural language. | ||
* [**rehype**][rehype] ([**HAST**][hast]) — HTML | ||
* [**remark**][remark] ([**MDAST**][mdast]) — Markdown | ||
* [**retext**][retext] ([**NLCST**][nlcst]) — Natural language | ||
@@ -169,3 +173,3 @@ ###### File | ||
var markdown = require('remark-parse'); | ||
var lint = require('remark-lint'); | ||
var styleGuide = require('remark-preset-lint-markdown-style-guide'); | ||
var remark2retext = require('remark-retext'); | ||
@@ -180,9 +184,9 @@ var english = require('retext-english'); | ||
.use(markdown) | ||
.use(lint) | ||
.use(styleGuide) | ||
.use(remark2retext, unified().use(english).use(equality)) | ||
.use(remark2rehype) | ||
.use(html) | ||
.process('## Hey guys', function (err, file) { | ||
console.err(reporter(err || file)); | ||
console.log(file.toString()); | ||
.process('*Emphasis* and _importance_, you guys!', function (err, file) { | ||
console.error(reporter(err || file)); | ||
console.log(String(file)); | ||
}); | ||
@@ -194,7 +198,7 @@ ``` | ||
```txt | ||
1:1-1:12 warning First heading level should be `1` first-heading-level | ||
1:8-1:12 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men | ||
1:16-1:28 warning Emphasis should use `*` as a marker emphasis-marker remark-lint | ||
1:34-1:38 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men retext-equality | ||
⚠ 3 warnings | ||
<h2>Hey guys</h2> | ||
⚠ 2 warnings | ||
<p><em>Emphasis</em> and <em>importance</em>, you guys!</p> | ||
``` | ||
@@ -248,3 +252,3 @@ | ||
process.stdin.pipe(concat(function (buf) { | ||
process.stdout.write(remark().processSync(buf)) | ||
process.stdout.write(remark().processSync(buf).toString()); | ||
})); | ||
@@ -260,14 +264,14 @@ ``` | ||
* `processor.use(plugin[, options])`; | ||
* `processor.use(preset)`; | ||
* `processor.use(list)`; | ||
* `processor.use(plugin[, options])` | ||
* `processor.use(preset)` | ||
* `processor.use(list)` | ||
###### Parameters | ||
* `plugin` ([`Plugin`][plugin]); | ||
* `options` (`*`, optional) — Configuration for `plugin`. | ||
* `plugin` ([`Plugin`][plugin]) | ||
* `options` (`*`, optional) — Configuration for `plugin` | ||
* `preset` (`Object`) — Object with an optional `plugins` (set to `list`), | ||
and/or an optional `settings` object; | ||
and/or an optional `settings` object | ||
* `list` (`Array`) — plugins, presets, and arguments (a plugin and options | ||
in an array), in an array. | ||
in an array), in an array | ||
@@ -314,3 +318,3 @@ ###### Returns | ||
* `file` ([**VFile**][file]) | ||
— Or anything which can be given to `vfile()`. | ||
— Or anything which can be given to `vfile()` | ||
@@ -344,5 +348,5 @@ ###### Returns | ||
* `node` ([**Node**][node]); | ||
* `node` ([**Node**][node]) | ||
* `file` ([**VFile**][file], optional); | ||
— Or anything which can be given to `vfile()`. | ||
— Or anything which can be given to `vfile()` | ||
@@ -377,6 +381,6 @@ ###### Returns | ||
* `node` ([**Node**][node]); | ||
* `file` ([**VFile**][file], optional); | ||
— Or anything which can be given to `vfile()`. | ||
* `done` ([`Function`][run-done], optional). | ||
* `node` ([**Node**][node]) | ||
* `file` ([**VFile**][file], optional) | ||
— Or anything which can be given to `vfile()` | ||
* `done` ([`Function`][run-done], optional) | ||
@@ -399,5 +403,5 @@ ###### Returns | ||
* `err` (`Error`) — Fatal error; | ||
* `node` ([**Node**][node]); | ||
* `file` ([**VFile**][file]). | ||
* `err` (`Error`) — Fatal error | ||
* `node` ([**Node**][node]) | ||
* `file` ([**VFile**][file]) | ||
@@ -412,5 +416,5 @@ ### `processor.runSync(node[, file])` | ||
* `node` ([**Node**][node]); | ||
* `file` ([**VFile**][file], optional); | ||
— Or anything which can be given to `vfile()`. | ||
* `node` ([**Node**][node]) | ||
* `file` ([**VFile**][file], optional) | ||
— Or anything which can be given to `vfile()` | ||
@@ -433,5 +437,5 @@ ###### Returns | ||
* `file` ([**VFile**][file]); | ||
* `value` (`string`) — String representation of a file; | ||
* `done` ([`Function`][process-done], optional). | ||
* `file` ([**VFile**][file]) | ||
* `value` (`string`) — String representation of a file | ||
* `done` ([`Function`][process-done], optional) | ||
@@ -454,4 +458,4 @@ ###### Returns | ||
* `err` (`Error`, optional) — Fatal error; | ||
* `file` ([**VFile**][file]). | ||
* `err` (`Error`, optional) — Fatal error | ||
* `file` ([**VFile**][file]) | ||
@@ -464,3 +468,3 @@ ###### Example | ||
var remark2rehype = require('remark-rehype'); | ||
var document = require('rehype-document'); | ||
var doc = require('rehype-document'); | ||
var format = require('rehype-format'); | ||
@@ -473,3 +477,3 @@ var html = require('rehype-stringify'); | ||
.use(remark2rehype) | ||
.use(document) | ||
.use(doc) | ||
.use(format) | ||
@@ -482,3 +486,3 @@ .use(html) | ||
console.error(String(err)); | ||
}) | ||
}); | ||
``` | ||
@@ -511,4 +515,4 @@ | ||
* `file` ([**VFile**][file]); | ||
* `value` (`string`) — String representation of a file; | ||
* `file` ([**VFile**][file]) | ||
* `value` (`string`) — String representation of a file | ||
@@ -529,3 +533,3 @@ ###### Returns | ||
var remark2rehype = require('remark-rehype'); | ||
var document = require('rehype-document'); | ||
var doc = require('rehype-document'); | ||
var format = require('rehype-format'); | ||
@@ -538,3 +542,3 @@ var html = require('rehype-stringify'); | ||
.use(remark2rehype) | ||
.use(document) | ||
.use(doc) | ||
.use(format) | ||
@@ -570,9 +574,9 @@ .use(html); | ||
* `key` (`string`) — Identifier; | ||
* `value` (`*`, optional) — Value to set. Omit if getting `key`. | ||
* `key` (`string`) — Identifier | ||
* `value` (`*`, optional) — Value to set. Omit if getting `key` | ||
###### Returns | ||
* `processor` — If setting, the processor on which `data` is invoked; | ||
* `*` — If getting, the value at `key`. | ||
* `processor` — If setting, the processor on which `data` is invoked | ||
* `*` — If getting, the value at `key` | ||
@@ -660,3 +664,3 @@ ###### Note | ||
```txt | ||
~/node_modules/unified/index.js:436 | ||
~/node_modules/unified/index.js:440 | ||
throw new Error( | ||
@@ -667,4 +671,4 @@ ^ | ||
Create a new processor first, by invoking it: use `processor()` instead of `processor`. | ||
at assertUnfrozen (~/node_modules/unified/index.js:436:11) | ||
at Function.use (~/node_modules/unified/index.js:170:5) | ||
at assertUnfrozen (~/node_modules/unified/index.js:440:11) | ||
at Function.use (~/node_modules/unified/index.js:172:5) | ||
at Object.<anonymous> (~/b.js:6:4) | ||
@@ -679,5 +683,5 @@ ``` | ||
* It modifies the [**processor**][processor]: such as changing the | ||
parser, the compiler, or linking the processor to other processors; | ||
* It transforms the [**syntax tree**][node] representation of a file; | ||
* It modifies metadata of a file. | ||
parser, the compiler, or linking the processor to other processors | ||
* It transforms the [**syntax tree**][node] representation of a file | ||
* It modifies metadata of a file | ||
@@ -721,3 +725,3 @@ Plug-in’s are a concept which materialise as [**attacher**][attacher]s. | ||
rehype() | ||
unified() | ||
.use(parse) | ||
@@ -730,5 +734,5 @@ .use(remark2rehype) | ||
if (file) { | ||
vfile.writeSync(file); // written to `index.html` | ||
vfile.writeSync(file); // Written to `index.html`. | ||
} | ||
}) | ||
}); | ||
``` | ||
@@ -751,3 +755,3 @@ | ||
* `options` (`*`, optional) — Configuration. | ||
* `options` (`*`, optional) — Configuration | ||
@@ -778,15 +782,15 @@ ###### Returns | ||
* `node` ([**Node**][node]); | ||
* `file` ([**VFile**][file]); | ||
* `next` ([`Function`][next], optional). | ||
* `node` ([**Node**][node]) | ||
* `file` ([**VFile**][file]) | ||
* `next` ([`Function`][next], optional) | ||
###### Returns | ||
* `Error` — Can be returned to stop the process; | ||
* `Error` — Can be returned to stop the process | ||
* [**Node**][node] — Can be returned and results in further | ||
transformations and `stringify`s to be performed on the new | ||
tree; | ||
tree | ||
* `Promise` — If a promise is returned, the function is asynchronous, | ||
and **must** be resolved (optionally with a [**Node**][node]) or | ||
rejected (optionally with an `Error`). | ||
rejected (optionally with an `Error`) | ||
@@ -800,5 +804,5 @@ #### `function next(err[, tree[, file]])` | ||
* `err` (`Error`, optional) — Stop the process; | ||
* `node` ([**Node**][node], optional) — New syntax tree; | ||
* `file` ([**VFile**][file], optional) — New virtual file. | ||
* `err` (`Error`, optional) — Stop the process | ||
* `node` ([**Node**][node], optional) — New syntax tree | ||
* `file` ([**VFile**][file], optional) — New virtual file | ||
@@ -816,16 +820,11 @@ ## `Preset` | ||
```js | ||
exports.settings = {bullet: '*', fences: true} | ||
exports.settings = {bullet: '*', fences: true}; | ||
exports.plugins = [ | ||
[require('remark-preset-lint-recommended')] | ||
[require('remark-comment-config')], | ||
[require('remark-validate-links')], | ||
[require('remark-lint'), { | ||
blockquoteIndentation: 2, | ||
checkboxCharacterStyle: {checked: 'x', unchecked: ' '}, | ||
// ... | ||
}], | ||
[require('remark-toc'), {maxDepth: 3, tight: true}] | ||
[require('remark-github')] | ||
] | ||
require('remark-preset-lint-recommended'), | ||
require('remark-comment-config'), | ||
require('remark-preset-lint-markdown-style-guide'), | ||
[require('remark-toc'), {maxDepth: 3, tight: true}], | ||
require('remark-github') | ||
]; | ||
``` | ||
@@ -841,9 +840,11 @@ | ||
remark().use(preset).process(vfile.readSync('index.md'), function (err, file) { | ||
console.error(reporter(err || file)); | ||
remark() | ||
.use(preset) | ||
.process(vfile.readSync('index.md'), function (err, file) { | ||
console.error(reporter(err || file)); | ||
if (file) { | ||
vfile.writeSync(file); | ||
} | ||
}) | ||
if (file) { | ||
vfile.writeSync(file); | ||
} | ||
}); | ||
``` | ||
@@ -857,3 +858,3 @@ | ||
[logo]: https://cdn.rawgit.com/wooorm/unified/6056962/logo.svg | ||
[logo]: https://cdn.rawgit.com/unifiedjs/unified/84f55c8/logo.svg | ||
@@ -874,2 +875,6 @@ [travis-badge]: https://img.shields.io/travis/unifiedjs/unified.svg | ||
[site]: https://unifiedjs.github.io | ||
[guides]: https://unifiedjs.github.io/#guides | ||
[rehype]: https://github.com/wooorm/rehype | ||
@@ -876,0 +881,0 @@ |
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
38167
920