Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 7, 2016
1 parent 98a4f60 commit ad65819
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
17 changes: 8 additions & 9 deletions doc/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,20 @@ var equality = require('retext-equality');
var report = require('vfile-reporter');

retext()
.use(simplify)
.use(equality)
.process('Hey guys, utilize a shorter word.', function (err, file) {
console.log(file.toString());
console.error(report(file));
});
.use(simplify)
.use(equality)
.process('Hey guys, utilize a shorter word.', function (err, file) {
console.log(String(file));
console.error(report(err || file));
});
```

`node index.js` yields:

```txt
Hey guys, utilize a shorter word.
<stdin>
1:5-1:9 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men
1:11-1:18 warning Replace “utilize” with “use” utilize
1:5-1:9 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men retext-equality
1:11-1:18 warning Replace “utilize” with “use” utilize retext-simplify
⚠ 2 warnings
```
Expand Down
9 changes: 3 additions & 6 deletions packages/retext/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,16 @@ retext()
.use(profanities)
.use(emoji, {convert: 'encode'})
.process('He’s set on beating your butt for sheriff! :cop:', function (err, file) {
file.filename = 'example';
file.extension = 'txt';
console.log(file.toString());
console.error(report(file));
console.log(String(file));
console.error(report(err || file));
});
```

Yields:

```txt
He’s set on beating your butt for sheriff! 👮
example.txt
26-1:30 warning Be careful with “butt”, it’s profane in some cases butt
1:26-1:30 warning Be careful with “butt”, it’s profane in some cases butt retext-profanities
⚠ 1 warning
```
Expand Down

0 comments on commit ad65819

Please sign in to comment.