Sign inSign up

mgbi/redoc-cli

By mgbi

•Updated over 5 years ago

Docker image for Redoc CLI

Image
0

893

mgbi/redoc-cli repository overview

⁠ReDoc CLI Docker image

Docker Pulls License

Docker image for ReDoc⁠.

It allows you to bundle your Swagger docs into a zero-dependency HTML file.

⁠Installation

docker pull mgbi/redoc-cli

⁠Usage

See help.

docker run --rm mgbi/redoc-cli

Bundle Swagger docs and ReDoc into a zero-dependency HTML file.

docker run --rm mgbi/redoc-cli --volume $PWD:/mnt --workdir /mnt mgbi/redoc-cli bundle YOUR_FILE.yaml

The HTML file will be bundled in $PWD/redoc-static.html.

Start the sever with Swagger docs rendered with ReDoc. Supports SSR mode (--ssr) and can watch the spec (--watch:

docker run --rm mgbi/redoc-cli --volume $PWD/YOUR_FILE.yml:/mnt/swagger.yaml --publish 8080:8080 mgbi/redoc-cli serve /mnt/swagger.yaml

Available options: https://github.com/Redocly/redoc#redoc-options-object⁠

Available theme options: https://github.com/Redocly/redoc/blob/master/src/theme.ts⁠

Some examples:

  • Bundle with main color changed to orange:
    $ redoc-cli bundle [spec] --options.theme.colors.primary.main=orange
  • Serve with nativeScrollbars option set to true:
    $ redoc-cli serve [spec] --options.nativeScrollbars
  • Bundle using custom template (check default template⁠ for reference):
    $ redoc-cli bundle [spec] -t custom.hbs
  • Bundle using custom template and add custom templateOptions:
    $ redoc-cli bundle [spec] -t custom.hbs --templateOptions.metaDescription "Page meta description"

⁠Swagger YAML file

See how to validate Swagger files or bundle them into a combined file:

https://github.com/MGBI/docker-swagger-cli⁠

⁠More help?

See https://github.com/Redocly/redoc⁠ for further information.

Tag summary

Content type

Image

Digest

Size

63 MB

Last updated

over 5 years ago

docker pull mgbi/redoc-cli