mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-10 19:06:34 +03:00
docs: improve the redoc cli README (#1679)
- Break some long lines - Add some articles (the, a) - Add a couple links for additional context - Expand the SSR acronym - Describe what --watch does
This commit is contained in:
parent
bb67e29bbf
commit
eba55124c9
|
@ -3,20 +3,29 @@
|
||||||
**[ReDoc](https://github.com/Redocly/redoc)'s Command Line Interface**
|
**[ReDoc](https://github.com/Redocly/redoc)'s Command Line Interface**
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
You can use redoc cli by installing `redoc-cli` globally or using [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b).
|
|
||||||
|
You can use `redoc-cli` by installing [the package](https://www.npmjs.com/package/redoc-cli) globally,
|
||||||
|
or using [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Two following commands are available:
|
The two following commands 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 serve [spec]` - starts the server with `spec` rendered with ReDoc.
|
||||||
- `redoc-cli bundle [spec]` - bundles spec and ReDoc into **zero-dependency** HTML file.
|
Supports a server-side rendering mode (`--ssr`),
|
||||||
|
and can watch the spec (`--watch`) to automatically reload the page whenever it changes.
|
||||||
|
- `redoc-cli bundle [spec]` - bundles `spec` and ReDoc into a **zero-dependency** HTML file.
|
||||||
|
|
||||||
Some examples:
|
Some examples:
|
||||||
|
|
||||||
- Bundle with main color changed to `orange`: <br> `$ redoc-cli bundle [spec] --options.theme.colors.primary.main=orange`
|
- Bundle with the main color changed to `orange`:<br/>
|
||||||
- Serve with `nativeScrollbars` option set to true: <br> `$ redoc-cli serve [spec] --options.nativeScrollbars`
|
`$ redoc-cli bundle [spec] --options.theme.colors.primary.main=orange`
|
||||||
- Bundle using custom template (check [default template](https://github.com/Redocly/redoc/blob/master/cli/template.hbs) for reference): <br> `$ redoc-cli bundle [spec] -t custom.hbs`
|
- Serve with the `nativeScrollbars` option set to true:<br/>
|
||||||
- Bundle using custom template and add custom `templateOptions`: <br> `$ redoc-cli bundle [spec] -t custom.hbs --templateOptions.metaDescription "Page meta description"`
|
`$ redoc-cli serve [spec] --options.nativeScrollbars`
|
||||||
|
- Bundle using a custom [Handlebars](https://handlebarsjs.com/) template
|
||||||
|
(check the [default template](https://github.com/Redocly/redoc/blob/master/cli/template.hbs) for an example):<br/>
|
||||||
|
`$ redoc-cli bundle [spec] -t custom.hbs`
|
||||||
|
- Bundle using a custom template and add custom `templateOptions`:<br/>
|
||||||
|
`$ redoc-cli bundle [spec] -t custom.hbs --templateOptions.metaDescription "Page meta description"`
|
||||||
|
|
||||||
For more details run `redoc-cli --help`.
|
For more details, run `redoc-cli --help`.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user