|
| 1 | +# remark-cli [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat] |
| 2 | + |
| 3 | +Command-line interface for [**remark**][remark]. |
| 4 | + |
| 5 | +* Loads [`remark-` plugins][plugins] |
| 6 | +* Searches for [markdown extensions][markdown-extensions] |
| 7 | +* Ignores paths found in [`.remarkignore` files][ignore-file] |
| 8 | +* Loads configuration from [`.remarkrc`, `.remarkrc.js` files][config-file] |
| 9 | +* Uses configuration from [`remarkConfig` fields in `package.json` |
| 10 | + files][config-file] |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +[npm][]: |
| 15 | + |
| 16 | +```sh |
| 17 | +npm install remark-cli |
| 18 | +``` |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +```sh |
| 23 | +# Add a table of contents to `readme.md` |
| 24 | +$ remark readme.md --use toc --output |
| 25 | + |
| 26 | +# Lint markdown files in the current directory |
| 27 | +# according to the markdown style guide. |
| 28 | +$ remark . --use preset-lint-markdown-style-guide |
| 29 | +``` |
| 30 | + |
| 31 | +## CLI |
| 32 | + |
| 33 | +See [**unified-args**][unified-args], which provides the interface, |
| 34 | +for more information on all available options. |
| 35 | + |
| 36 | +```txt |
| 37 | +Usage: remark [options] [path | glob ...] |
| 38 | +
|
| 39 | + CLI to process markdown with remark using plugins |
| 40 | +
|
| 41 | +Options: |
| 42 | +
|
| 43 | + -h --help output usage information |
| 44 | + -v --version output version number |
| 45 | + -o --output [path] specify output location |
| 46 | + -r --rc-path <path> specify configuration file |
| 47 | + -i --ignore-path <path> specify ignore file |
| 48 | + -s --setting <settings> specify settings |
| 49 | + -e --ext <extensions> specify extensions |
| 50 | + -u --use <plugins> use plugins |
| 51 | + -p --preset <presets> use presets |
| 52 | + -w --watch watch for changes and reprocess |
| 53 | + -q --quiet output only warnings and errors |
| 54 | + -S --silent output only errors |
| 55 | + -f --frail exit with 1 on warnings |
| 56 | + -t --tree specify input and output as syntax tree |
| 57 | + --file-path <path> specify path to process as |
| 58 | + --tree-in specify input as syntax tree |
| 59 | + --tree-out output syntax tree |
| 60 | + --[no-]stdout specify writing to stdout (on by default) |
| 61 | + --[no-]color specify color in report (on by default) |
| 62 | + --[no-]config search for configuration files (on by default) |
| 63 | + --[no-]ignore search for ignore files (on by default) |
| 64 | +
|
| 65 | +Examples: |
| 66 | +
|
| 67 | + # Process `input.md` |
| 68 | + $ remark input.md -o output.md |
| 69 | +
|
| 70 | + # Pipe |
| 71 | + $ remark < input.md > output.md |
| 72 | +
|
| 73 | + # Rewrite all applicable files |
| 74 | + $ remark . -o |
| 75 | +``` |
| 76 | + |
| 77 | +## License |
| 78 | + |
| 79 | +[MIT][license] © [Titus Wormer][author] |
| 80 | + |
| 81 | +<!-- Definitions --> |
| 82 | + |
| 83 | +[build-badge]: https://img.shields.io/travis/wooorm/remark.svg |
| 84 | + |
| 85 | +[build-status]: https://travis-ci.org/wooorm/remark |
| 86 | + |
| 87 | +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark.svg |
| 88 | + |
| 89 | +[coverage-status]: https://codecov.io/github/wooorm/remark |
| 90 | + |
| 91 | +[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg |
| 92 | + |
| 93 | +[chat]: https://gitter.im/wooorm/remark |
| 94 | + |
| 95 | +[license]: https://github.com/wooorm/remark/blob/master/LICENSE |
| 96 | + |
| 97 | +[author]: http://wooorm.com |
| 98 | + |
| 99 | +[npm]: https://docs.npmjs.com/cli/install |
| 100 | + |
| 101 | +[remark]: https://github.com/wooorm/remark |
| 102 | + |
| 103 | +[plugins]: https://github.com/wooorm/remark/blob/master/doc/plugins.md |
| 104 | + |
| 105 | +[markdown-extensions]: https://github.com/sindresorhus/markdown-extensions |
| 106 | + |
| 107 | +[config-file]: https://github.com/wooorm/unified-engine/blob/master/doc/configure.md |
| 108 | + |
| 109 | +[ignore-file]: https://github.com/wooorm/unified-engine/blob/master/doc/ignore.md |
| 110 | + |
| 111 | +[unified-args]: https://github.com/wooorm/unified-args#cli |
0 commit comments