-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,6 @@ | ||
![retext][logo] | ||
# Getting started | ||
|
||
# Getting Started | ||
See [the monorepo readme][retext] for what the retext ecosystem is and examples | ||
of how to get started. | ||
|
||
**retext** transforms natural language. | ||
It’s an ecosystem of [plugins][]. | ||
If you get stuck, [issues][] and [discussions][] are good places to get help. | ||
|
||
retext is built on [unified][], make sure to read it and its [website][] too. | ||
|
||
## Contents | ||
|
||
* [Introduction](#introduction) | ||
* [Programmatic usage](#programmatic-usage) | ||
|
||
## Introduction | ||
|
||
Out of the box, **retext** doesn’t do anything. | ||
But much can be done [through plugins][plugins]. | ||
|
||
## Programmatic usage | ||
|
||
The programmatic interface of **retext** is provided by [**unified**][unified]. | ||
In fact, [`retext`][api] is two plugins: | ||
[`retext-latin`][latin] and [`retext-stringify`][stringify]. | ||
|
||
Install [`retext`][api] with [npm][]: | ||
|
||
```bash | ||
npm install retext retext-equality retext-simplify | ||
``` | ||
|
||
`index.js` contains: | ||
|
||
```js | ||
import {retext} from 'retext' | ||
import {reporter} from 'vfile-reporter' | ||
import retextSimplify from 'retext-simplify' | ||
import retextEquality from 'retext-equality' | ||
|
||
retext() | ||
.use(retextSimplify) | ||
.use(retextEquality) | ||
.process('Hey guys, utilize a shorter word.') | ||
.then((file) => { | ||
console.log(String(file)) | ||
console.error(reporter(file)) | ||
}) | ||
``` | ||
|
||
`node index.js` yields: | ||
|
||
```txt | ||
Hey guys, utilize a shorter word. | ||
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 | ||
``` | ||
|
||
<!-- Definitions --> | ||
|
||
[logo]: https://raw.githubusercontent.com/retextjs/retext/3420f05/logo.svg?sanitize=true | ||
|
||
[issues]: https://github.com/retextjs/retext/issues | ||
|
||
[discussions]: https://github.com/retextjs/retext/discussions | ||
|
||
[npm]: https://docs.npmjs.com/cli/install | ||
|
||
[api]: https://github.com/retextjs/retext/tree/main/packages/retext | ||
|
||
[plugins]: https://github.com/retextjs/retext/tree/main/doc/plugins.md | ||
|
||
[unified]: https://github.com/unifiedjs/unified | ||
|
||
[website]: https://unifiedjs.com | ||
|
||
[latin]: https://github.com/retextjs/retext/tree/main/packages/retext-latin | ||
|
||
[stringify]: https://github.com/retextjs/retext/tree/main/packages/retext-stringify | ||
[retext]: https://github.com/retextjs/retext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters