@@ -29,10 +29,9 @@ Command line interface to inspect and change markdown files with **[remark][]**.
2929
3030This package is a command line interface (CLI) that you can use in your terminal
3131or in npm scripts and the like to inspect and change markdown files.
32- This CLI is built around remark, which is a very popular ecosystem of plugins
33- that work with markdown as structured data, specifically ASTs (abstract syntax
34- trees).
35- You can choose from the 150+ plugins that already exist or make your own.
32+ This CLI is built around remark, which is an ecosystem of plugins that work with
33+ markdown as structured data, specifically ASTs (abstract syntax trees).
34+ You can choose from the 150+ existing plugins or make your own.
3635
3736See [ the monorepo readme] [ remark ] for info on what the remark ecosystem is.
3837
@@ -46,8 +45,8 @@ If not, you can always use [`remark`][remark-core] itself manually in a script.
4645
4746## Install
4847
49- This package is [ ESM only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) .
50- In Node.js (version 14.14+, or 16.0 +), install with [ npm] [ ] :
48+ This package is [ ESM only] [ esm ] .
49+ In Node.js (version 16 +), install with [ npm] [ ] :
5150
5251``` sh
5352npm install remark-cli
@@ -58,7 +57,7 @@ npm install remark-cli
5857Add a table of contents with [ ` remark-toc ` ] [ remark-toc ] to ` readme.md ` :
5958
6059``` sh
61- remark readme.md --use remark-toc --output
60+ remark readme.md --output -- use remark-toc
6261```
6362
6463Lint all markdown files in the current directory according to the markdown style
@@ -80,31 +79,32 @@ Usage: remark [options] [path | glob ...]
8079
8180Options:
8281
82+ --[no-]color specify color in report (on by default)
83+ --[no-]config search for configuration files (on by default)
84+ -e --ext <extensions> specify extensions
85+ --file-path <path> specify path to process as
86+ -f --frail exit with 1 on warnings
8387 -h --help output usage information
84- -v --version output version number
88+ --[no-]ignore search for ignore files (on by default)
89+ -i --ignore-path <path> specify ignore file
90+ --ignore-path-resolve-from cwd|dir resolve patterns in `ignore-path` from its directory or cwd
91+ --ignore-pattern <globs> specify ignore patterns
92+ --inspect output formatted syntax tree
8593 -o --output [path] specify output location
94+ -q --quiet output only warnings and errors
8695 -r --rc-path <path> specify configuration file
87- -i --ignore-path <path > specify ignore file
96+ --report <reporter > specify reporter
8897 -s --setting <settings> specify settings
89- -e --ext <extensions> specify extensions
90- -u --use <plugins> use plugins
91- -w --watch watch for changes and reprocess
92- -q --quiet output only warnings and errors
9398 -S --silent output only errors
94- -f --frail exit with 1 on warnings
95- -t --tree specify input and output as syntax tree
96- --report <reporter> specify reporter
97- --file-path <path> specify path to process as
98- --ignore-path-resolve-from dir|cwd resolve patterns in `ignore-path` from its directory or cwd
99- --ignore-pattern <globs> specify ignore patterns
10099 --silently-ignore do not fail when given ignored files
100+ --[no-]stdout specify writing to stdout (on by default)
101+ -t --tree specify input and output as syntax tree
101102 --tree-in specify input as syntax tree
102103 --tree-out output syntax tree
103- --inspect output formatted syntax tree
104- --[no-]stdout specify writing to stdout (on by default)
105- --[no-]color specify color in report (on by default)
106- --[no-]config search for configuration files (on by default)
107- --[no-]ignore search for ignore files (on by default)
104+ -u --use <plugins> use plugins
105+ --verbose report extra info for messages
106+ -v --version output version number
107+ -w --watch watch for changes and reprocess
108108
109109Examples:
110110
@@ -118,17 +118,17 @@ Examples:
118118 $ remark . -o
119119```
120120
121- More information on all these options is available at
122- [ ` unified-args ` ] [ unified-args ] , which does the work.
121+ More info on all these options is available at [ ` unified-args ` ] [ unified-args ] ,
122+ which does the work.
123123` remark-cli ` is ` unified-args ` preconfigured to:
124124
125- * Load ` remark- ` plugins
126- * Search for markdown extensions
125+ * load ` remark- ` plugins
126+ * search for markdown extensions
127127 ([ ` .md ` , ` .markdown ` , etc] [ markdown-extensions ] )
128- * Ignore paths found in [ ` .remarkignore ` files] [ ignore-file ]
129- * Load configuration from
128+ * ignore paths found in [ ` .remarkignore ` files] [ ignore-file ]
129+ * load configuration from
130130 [ ` .remarkrc ` , ` .remarkrc.js ` , etc files] [ config-file ]
131- * Use configuration from
131+ * use configuration from
132132 [ ` remarkConfig ` fields in ` package.json ` files] [ config-file ]
133133
134134## Examples
@@ -138,13 +138,13 @@ More information on all these options is available at
138138This example checks and formats markdown with ` remark-cli ` .
139139It assumes you’re in a Node.js package.
140140
141- First, install the CLI and plugins:
141+ Install the CLI and plugins:
142142
143143``` sh
144- npm install remark-cli remark-toc remark- preset-lint-consistent remark-preset-lint-recommended --save-dev
144+ npm install remark-cli remark-preset-lint-consistent remark-preset-lint-recommended remark-toc --save-dev
145145```
146146
147- Now, add an npm script in your ` package.json ` :
147+ …then add an npm script in your ` package.json ` :
148148
149149``` js
150150 /* … */
@@ -158,7 +158,7 @@ Now, add an npm script in your `package.json`:
158158
159159> 💡 ** Tip** : add ESLint and such in the ` format ` script too.
160160
161- Observe that the above change adds a ` format ` script, which can be run with
161+ The above change adds a ` format ` script, which can be run with
162162` npm run format ` .
163163It runs remark on all markdown files (` . ` ) and rewrites them (` --output ` ).
164164Run ` ./node_modules/.bin/remark --help ` for more info on the CLI.
@@ -188,7 +188,7 @@ Then, add a `remarkConfig` to your `package.json` to configure remark:
188188```
189189
190190> 👉 ** Note** : you must remove the comments in the above examples when
191- > copy/pasting them, as comments are not supported in ` package.json ` files.
191+ > copy/pasting them as comments are not supported in ` package.json ` files.
192192
193193Finally, you can run the npm script to check and format markdown files in your
194194project:
@@ -269,20 +269,23 @@ Earlier wins (so in the above file structure `folder/.remarkrc.js` wins over
269269`folder/package.json`) :
270270
2712711. `.remarkrc` (JSON)
272- 2. `.remarkrc.json` (JSON)
2732723. `.remarkrc.cjs` (CJS)
274- 4. `.remarkrc.mjs` (ESM)
2752735. `.remarkrc.js` (CJS or ESM, depending on `type : ' module' ` in ` package.json`)
274+ 2. `.remarkrc.json` (JSON)
275+ 4. `.remarkrc.mjs` (ESM)
2762766. `.remarkrc.yaml` (YAML)
2772777. `.remarkrc.yml` (YAML)
2782788. `package.json` with `remarkConfig` field
279279
280280# # Compatibility
281281
282- Projects maintained by the unified collective are compatible with all maintained
282+ Projects maintained by the unified collective are compatible with maintained
283283versions of Node.js.
284- As of now, that is Node.js 14.14+, and 16.0+.
285- Our projects sometimes work with older versions, but this is not guaranteed.
284+
285+ When we cut a new major release, we drop support for unmaintained versions of
286+ Node.
287+ This means we try to keep the current release line, `remark-cli@^11`,
288+ compatible with Node.js 12.
286289
287290# # Security
288291
@@ -311,8 +314,6 @@ abide by its terms.
311314
312315Support this effort and give back by sponsoring on [OpenCollective][collective]!
313316
314- <!--lint ignore no-html-->
315-
316317<table>
317318<tr valign="middle">
318319<td width="20%" align="center" rowspan="2" colspan="2">
@@ -424,24 +425,26 @@ Support this effort and give back by sponsoring on [OpenCollective][collective]!
424425
425426[npm] : https://docs.npmjs.com/cli/install
426427
427- [xss] : https://en.wikipedia.org/wiki/Cross-site_scripting
428+ [esm] : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
429+
430+ [markdown-extensions] : https://github.com/sindresorhus/markdown-extensions
428431
429432[rehype] : https://github.com/rehypejs/rehype
430433
431434[rehype-sanitize] : https://github.com/rehypejs/rehype-sanitize
432435
433436[remark] : https://github.com/remarkjs/remark
434437
435- [markdown-extensions] : https://github.com/sindresorhus/markdown-extensions
436-
437- [config-file] : https://github.com/unifiedjs/unified-engine/blob/main/doc/configure.md
438+ [remark-core] : ../remark/
438439
439- [ignore-file ] : https://github.com/unifiedjs/unified-engine/blob/main/doc/ignore.md
440+ [remark-toc ] : https://github.com/remarkjs/remark-toc
440441
441- [unified-args ] : https://github.com/unifiedjs/unified-args#cli
442+ [config-file ] : https://github.com/unifiedjs/unified-engine#config-files
442443
443- [remark-core ] : ../remark
444+ [ignore-file ] : https://github.com/unifiedjs/unified-engine#ignore-files
444445
445- [remark-toc ] : https://github.com/remarkjs/remark-toc
446+ [unified-args ] : https://github.com/unifiedjs/unified-args#cli
446447
447448[markdown-style-guide] : https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-markdown-style-guide
449+
450+ [xss] : https://en.wikipedia.org/wiki/Cross-site_scripting
0 commit comments