docs: add CLI examples

This commit is contained in:
Roman Hotsiy 2018-03-20 11:39:53 +02:00
parent 2732c89316
commit 3f6e221b4c
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 21 additions and 12 deletions

View File

@ -167,14 +167,7 @@ Here are detailed [options docs](#redoc-options-object).
## ReDoc CLI
You can use redoc cli by installing `redoc-cli` globally or using [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b).
Twe following commans are available:
- `redoc-cli serve [spec]` - starts the server with `spec` rendered with ReDoc. Supports SSR mode (`--ssr`) and can watch the spec (`--watch`)
- `redoc-cli bundle [spec]` - bundles spec and ReDoc into **zero-dependency** HTML file.
For more details run `redoc-cli --help`.
[See here](https://github.com/Rebilly/ReDoc/blob/react-rewrite/cli/README.md)
## Configuration

View File

@ -2,10 +2,26 @@
**[ReDoc](https://github.com/Rebilly/ReDoc)'s Command Line Interface**
[Documentation](https://github.com/Rebilly/ReDoc/tree/react-rewrite#redoc-cli)
## Installation
TBD
You can use redoc cli by installing `redoc-cli` globally or using [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b).
## Usage
TBD
Twe following commans are available:
- `redoc-cli serve [spec]` - starts the server with `spec` rendered with ReDoc. Supports SSR mode (`--ssr`) and can watch the spec (`--watch`)
- `redoc-cli bundle [spec]` - bundles spec and ReDoc into **zero-dependency** HTML file.
Some examples:
- Bundle with main color changed to `orange`:
`$ redoc-cli bundle [spec] --options.theme.colors.main=orange`
- Serve with `nativeScrollbars` option set to true:
`$ redoc-cli serve [spec] --options.nativeScrollbars`
- Bundle using custom template (check [default template](https://github.com/Rebilly/ReDoc/blob/react-rewrite/cli/template.hbs) for reference):
`$ redoc-cli bundle [spec] -t custom.hbs`
For more details run `redoc-cli --help`.