Skip to content

Commit 3ef82d6

Browse files
committed
Refactor prose
1 parent f65e28e commit 3ef82d6

File tree

1 file changed

+105
-75
lines changed

1 file changed

+105
-75
lines changed

readme.md

+105-75
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
# unified-args [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
1+
# unified-args
2+
3+
[![Build][build-badge]][build]
4+
[![Coverage][coverage-badge]][coverage]
5+
[![Downloads][downloads-badge]][downloads]
6+
[![Sponsors][sponsors-badge]][collective]
7+
[![Backers][backers-badge]][collective]
8+
[![Chat][chat-badge]][chat]
29

310
Interface for creating CLIs around [**unified**][unified] processors.
4-
Wrapper around the [**engine**][engine] to configure it with command-line
5-
arguments. Should be `require`d and configured in an executable script,
6-
on its own, as it handles the whole process.
11+
Wrapper around [`unifiedjs/unified-engine`][engine] to configure it with
12+
command-line arguments.
13+
Should be `require`d and configured in an executable script, on its own, as it
14+
handles the whole process.
715

816
[`unifiedjs.github.io`][site], the website for **unified** provides a good
9-
overview about what unified can do. Make sure to visit it and try its
10-
introductionary [Guides][].
17+
overview about what unified can do.
18+
Make sure to visit it and try its introductionary [Guides][].
1119

12-
## Installation
20+
## Install
1321

1422
[npm][]:
1523

16-
```bash
24+
```sh
1725
npm install unified-args
1826
```
1927

20-
## Usage
28+
## Use
2129

22-
This example creates a CLI for [**remark**][remark], loading
23-
`remark-` plugins, searching for markdown files, and loading
24-
[configuration][config-file] and [ignore][ignore-file] files.
30+
This example creates a CLI for [**remark**][remark], loading `remark-` plugins,
31+
searching for markdown files, and loading [configuration][config-file] and
32+
[ignore][ignore-file] files.
2533

2634
`cli` (you can make it runnable with: `chmod +x cli`):
2735

@@ -119,9 +127,8 @@ All options are required.
119127

120128
## CLI
121129

122-
CLIs created with **unified-args**, such as the [example][usage] above,
123-
creates an interface similar to the below (run `cli --help` for accurate
124-
information):
130+
CLIs created with **unified-args**, such as the [example][usage] above, creates
131+
an interface similar to the below (run `cli --help` for accurate information):
125132

126133
```txt
127134
Usage: remark [options] [path | glob ...]
@@ -167,14 +174,14 @@ Examples:
167174

168175
All non-options are seen as input and can be:
169176

170-
* Paths (`cli README.txt`) and [globs][glob] (`cli *.txt`) pointing
171-
to files to load
177+
* Paths (`cli readme.txt`) and [globs][glob] (`cli *.txt`) pointing to files
178+
to load
172179
* Paths (`cli test`) and globs (`cli fixtures/{in,out}`) pointing to
173-
directories. These are searched for files with known [extensions][ext]
174-
which are not ignored by patterns in [ignore files][ignore-file].
175-
The default behaviour is to exclude files in `node_modules`
176-
and hidden directories (those starting with a dot: `.`) unless explicitly
177-
given
180+
directories.
181+
These are searched for files with known [extensions][ext] which are not
182+
ignored by patterns in [ignore files][ignore-file].
183+
The default behaviour is to exclude files in `node_modules` and hidden
184+
directories (those starting with a dot: `.`) unless explicitly given
178185

179186
<!-- Options: -->
180187

@@ -211,10 +218,10 @@ cli . --output doc
211218
cli input.txt --output doc/output.text
212219
```
213220

214-
Whether to write successfully processed files, and where to. Can be
215-
set from [configuration files][config-file].
221+
Whether to write successfully processed files, and where to.
222+
Can be set from [configuration files][config-file].
216223

217-
* If output is **not** given, files are not written to the file-system
224+
* If output is **not** given, files are not written to the file system
218225
* If output is given **without** `path`, input files are overwritten when
219226
successful
220227
* If output is given with `path` and it points to an existing directory,
@@ -236,8 +243,8 @@ set from [configuration files][config-file].
236243
cli . --rc-path config.json
237244
```
238245

239-
File-path to a JSON [configuration file][config-file] to load, regardless
240-
of [`--config`][config].
246+
File path to a JSON [configuration file][config-file] to load, regardless of
247+
[`--config`][config].
241248

242249
* **Default**: none
243250
* **Alias**: `-r`
@@ -249,7 +256,7 @@ of [`--config`][config].
249256
cli . --ignore-path .gitignore
250257
```
251258

252-
File-path to an [ignore file][ignore-file] to load, regardless of
259+
File path to an [ignore file][ignore-file] to load, regardless of
253260
[`--ignore`][ignore].
254261

255262
* **Default**: none
@@ -265,8 +272,8 @@ cli input.txt --setting echo-foxtrot:-2
265272
cli input.txt --setting 'golf: false, hotel-india: ["juliet", 1]'
266273
```
267274

268-
Configuration for the parser and compiler of the processor. Can be set
269-
from [configuration files][config-file].
275+
Configuration for the parser and compiler of the processor.
276+
Can be set from [configuration files][config-file].
270277

271278
The given settings are [JSON5][], with one exceptions: surrounding braces must
272279
not be used: `"foo": 1, "bar": "baz"` is valid
@@ -286,14 +293,14 @@ cli input.txt --report 'json=pretty:"\t"'
286293
cli input.txt --report pretty --report json # only last one is used
287294
```
288295

289-
[Reporter][] to load by its name or path, optionally with options, and use
290-
to report metadata about eevery processed file.
296+
[Reporter][] to load by its name or path, optionally with options, and use to
297+
report metadata about eevery processed file.
291298

292-
To pass options, follow the name by an equals sign (`=`) and settings,
293-
which have the same in syntax as [`--setting <settings>`][setting].
299+
To pass options, follow the name by an equals sign (`=`) and settings, which
300+
have the same in syntax as [`--setting <settings>`][setting].
294301

295-
The prefix `vfile-reporter-` can be omitted. Prefixed reporters are preferred
296-
over modules without prefix.
302+
The prefix `vfile-reporter-` can be omitted.
303+
Prefixed reporters are preferred over modules without prefix.
297304

298305
If multiple reporters are given, the last one is used.
299306

@@ -304,8 +311,9 @@ If multiple reporters are given, the last one is used.
304311
###### Note
305312

306313
The [`quiet`][quiet], [`silent`][silent], and [`color`][color] options may not
307-
work with the used reporter. If they are given, they are preferred over the
308-
same properties in reporter settings.
314+
work with the used reporter.
315+
If they are given, they are preferred over the same properties in reporter
316+
settings.
309317

310318
### `--use <plugin>`
311319

@@ -314,14 +322,15 @@ cli input.txt --use man
314322
cli input.txt --use 'toc=max-depth:3'
315323
```
316324

317-
Plug-in to load by its name or path, optionally with options, and use
318-
on every processed file. Can be set from [configuration files][config-file].
325+
Plugin to load by its name or path, optionally with options, and use on every
326+
processed file.
327+
Can be set from [configuration files][config-file].
319328

320-
To pass options, follow the plugin by an equals sign (`=`) and settings,
321-
which have the same in syntax as [`--setting <settings>`][setting].
329+
To pass options, follow the plugin by an equals sign (`=`) and settings, which
330+
have the same in syntax as [`--setting <settings>`][setting].
322331

323-
Plug-ins prefixed with the [configured `pluginPrefix`][configured] are
324-
preferred over modules without prefix.
332+
Plugins prefixed with the [configured `pluginPrefix`][configured] are preferred
333+
over modules without prefix.
325334

326335
* **Default**: none
327336
* **Alias**: `-u`
@@ -360,9 +369,9 @@ Process as normal, then watch found files and reprocess when they change.
360369
The watch is stopped when `SIGINT` is received (usually done by pressing
361370
`CTRL-C`).
362371

363-
If [`--output`][output] is given **without** `path` it is not honoured,
364-
to prevent an infinite loop. When the watch closes, a final process
365-
runs including `--output`.
372+
If [`--output`][output] is given **without** `path` it is not honoured, to
373+
prevent an infinite loop.
374+
When the watch closes, a final process runs including `--output`.
366375

367376
* **Default**: off
368377
* **Alias**: `-w`
@@ -373,8 +382,8 @@ runs including `--output`.
373382
cli --tree < input.json > output.json
374383
```
375384

376-
Treat input as a syntax tree in JSON and output the transformed syntax
377-
tree. This runs neither the [parsing nor the compilation phase][description].
385+
Treat input as a syntax tree in JSON and output the transformed syntax tree.
386+
This runs neither the [parsing nor the compilation phase][description].
378387

379388
* **Default**: off
380389
* **Alias**: `-t`
@@ -386,8 +395,8 @@ tree. This runs neither the [parsing nor the compilation phase][description].
386395
cli --tree-in < input.json > input.txt
387396
```
388397

389-
Treat input as a syntax tree in JSON. This does not run the [parsing
390-
phase][description].
398+
Treat input as a syntax tree in JSON.
399+
This does not run the [parsing phase][description].
391400

392401
* **Default**: off
393402
* **Engine**: [`treeIn`][engine-tree-in]
@@ -398,8 +407,8 @@ phase][description].
398407
cli --tree-out < input.txt > output.json
399408
```
400409

401-
Output the transformed syntax tree. This does not run the [compilation
402-
phase][description].
410+
Output the transformed syntax tree.
411+
This does not run the [compilation phase][description].
403412

404413
* **Default**: off
405414
* **Engine**: [`treeOut`][engine-tree-out]
@@ -423,8 +432,8 @@ This does not run the [compilation phase][description].
423432
cli input.txt --quiet
424433
```
425434

426-
Ignore files without any messages in the report. The default behaviour
427-
is to show a success message.
435+
Ignore files without any messages in the report.
436+
The default behaviour is to show a success message.
428437

429438
* **Default**: off
430439
* **Alias**: `-q`
@@ -446,7 +455,8 @@ work with the used reporter.
446455
cli input.txt --silent
447456
```
448457

449-
Show only fatal errors in the report. Turns [`--quiet`][quiet] on.
458+
Show only fatal errors in the report.
459+
Turns [`--quiet`][quiet] on.
450460

451461
* **Default**: off
452462
* **Alias**: `-S`
@@ -463,8 +473,8 @@ This option may not work depending on the reporter given in
463473
cli input.txt --frail
464474
```
465475

466-
Exit with a status code of `1` if warnings or errors occur. The default
467-
behaviour is to exit with `1` on errors.
476+
Exit with a status code of `1` if warnings or errors occur.
477+
The default behaviour is to exit with `1` on errors.
468478

469479
* **Default**: off
470480
* **Alias**: `-f`
@@ -489,8 +499,8 @@ cli input.txt --no-stdout
489499

490500
Whether to write a processed file to **stdout**(4).
491501

492-
* **Default**: off if [`--output`][output] or [`--watch`][watch] are given,
493-
or if multiple files could be processed
502+
* **Default**: off if [`--output`][output] or [`--watch`][watch] are given, or
503+
if multiple files could be processed
494504
* **Engine**: [`out`][engine-out]
495505

496506
### `--color`
@@ -547,33 +557,57 @@ CLIs created with **unified-args** exit with:
547557

548558
## Debugging
549559

550-
CLIs can be debugged by setting the [`DEBUG`][debug] environment
551-
variable to `*`, such as `DEBUG="*" cli example.txt`.
560+
CLIs can be debugged by setting the [`DEBUG`][debug] environment variable to
561+
`*`, such as `DEBUG="*" cli example.txt`.
552562

553563
## Contribute
554564

555-
See [`contribute.md` in `unifiedjs/unified`][contribute] for ways to get
556-
started.
565+
See [`contributing.md`][contributing] in [`unifiedjs/.github`][health] for ways
566+
to get started.
567+
See [`support.md`][support] for ways to get help.
557568

558-
This organisation has a [Code of Conduct][coc]. By interacting with this
559-
repository, organisation, or community you agree to abide by its terms.
569+
This project has a [Code of Conduct][coc].
570+
By interacting with this repository, organisation, or community you agree to
571+
abide by its terms.
560572

561573
## License
562574

563575
[MIT][license] © [Titus Wormer][author]
564576

565577
<!-- Definitions -->
566578

567-
[travis-badge]: https://img.shields.io/travis/unifiedjs/unified-args.svg
579+
[build-badge]: https://img.shields.io/travis/unifiedjs/unified-args.svg
580+
581+
[build]: https://travis-ci.org/unifiedjs/unified-args
582+
583+
[coverage-badge]: https://img.shields.io/codecov/c/github/unifiedjs/unified-args.svg
584+
585+
[coverage]: https://codecov.io/github/unifiedjs/unified-args
586+
587+
[downloads-badge]: https://img.shields.io/npm/dm/unified-args.svg
568588

569-
[travis]: https://travis-ci.org/unifiedjs/unified-args
589+
[downloads]: https://www.npmjs.com/package/unified-args
570590

571-
[codecov-badge]: https://img.shields.io/codecov/c/github/unifiedjs/unified-args.svg
591+
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
572592

573-
[codecov]: https://codecov.io/github/unifiedjs/unified-args
593+
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
594+
595+
[collective]: https://opencollective.com/unified
596+
597+
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
598+
599+
[chat]: https://spectrum.chat/unified
574600

575601
[npm]: https://docs.npmjs.com/cli/install
576602

603+
[health]: https://github.com/unifiedjs/.github
604+
605+
[contributing]: https://github.com/unifiedjs/.github/blob/master/contributing.md
606+
607+
[support]: https://github.com/unifiedjs/.github/blob/master/support.md
608+
609+
[coc]: https://github.com/unifiedjs/.github/blob/master/code-of-conduct.md
610+
577611
[license]: license
578612

579613
[author]: https://wooorm.com
@@ -652,7 +686,7 @@ repository, organisation, or community you agree to abide by its terms.
652686

653687
[configured]: #startconfiguration
654688

655-
[usage]: #usage
689+
[usage]: #use
656690

657691
[watch]: #--watch
658692

@@ -689,7 +723,3 @@ repository, organisation, or community you agree to abide by its terms.
689723
[inspect]: https://github.com/syntax-tree/unist-util-inspect
690724

691725
[json5]: https://github.com/json5/json5
692-
693-
[contribute]: https://github.com/unifiedjs/unified/blob/master/contributing.md
694-
695-
[coc]: https://github.com/unifiedjs/unified/blob/master/code-of-conduct.md

0 commit comments

Comments
 (0)