Skip to content

Commit

Permalink
sync: Synced local 'docs/' with remote 'docs/redoc/'
Browse files Browse the repository at this point in the history
  • Loading branch information
redocly-bot committed Oct 9, 2023
1 parent ff492b5 commit 75065a2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 26 deletions.
5 changes: 3 additions & 2 deletions docs/deployment/cli.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
title: Use the Redoc CLI
redirectFrom:
- /docs/redoc/quickstart/cli/
redirects:
'/docs/redoc/quickstart/cli/':
to: '/docs/redoc/deployment/cli/'
---

# How to use the Redocly CLI
Expand Down
5 changes: 3 additions & 2 deletions docs/deployment/docker.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
title: Use the Redoc Docker image
redirectFrom:
- /docs/redoc/quickstart/docker/
redirects:
'/docs/redoc/quickstart/docker/':
to: '/docs/redoc/deployment/docker/'
---

# How to use the Redoc Docker image
Expand Down
16 changes: 8 additions & 8 deletions docs/deployment/html.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
title: Use Redoc in HTML
redirectFrom:
- /docs/redoc/quickstart/html/
- /docs/redoc/quickstart/
title: Use the Redoc HTML element
redirects:
'/docs/redoc/quickstart/html/':
to: '/docs/redoc/deployment/html/'
'/docs/redoc/quickstart/':
to: '/docs/redoc/deployment/html/'
---

# Use Redoc in HTML
Expand Down Expand Up @@ -38,11 +40,9 @@ description.
</html>
```

:::success URL or local file

{ % admonition type="success" name="URL or local file" % }
Set `spec-url` to a relative path if the file is local, e.g. `spec-url=my-api.yaml`. Use a full URL like the example above if it's hosted elsewhere.

:::
{ % /admonition % }

Open the HTML file in your browser to see the HTML documentation rendering. You may want to read the next section and add some configuration to make your documentation your own.

Expand Down
11 changes: 6 additions & 5 deletions docs/deployment/intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
title: Redoc deployment guide
redirectFrom:
- /docs/redoc/quickstart/intro/
redirects:
'/docs/redoc/quickstart/intro/':
to: '/docs/redoc/deployment/intro/'
---

# Redoc deployment guide
Expand Down Expand Up @@ -37,10 +38,10 @@ You need an OpenAPI definition. For testing purposes, you can use one of the fol
- [Thingful OpenAPI Definition](https://raw.githubusercontent.com/thingful/openapi-spec/master/spec/swagger.yaml)
- [Fitbit Plus OpenAPI Definition](https://raw.githubusercontent.com/TwineHealth/TwineDeveloperDocs/master/spec/swagger.yaml)

:::info OpenAPI specification
{% admonition type="info" name="OpenAPI specification" %}
For more information on the OpenAPI specification, refer to the [Learning OpenAPI 3](https://redocly.com/docs/resources/learning-openapi/)
section in the documentation.
:::
{% /admonition %}

### How to run Redoc locally

Expand Down Expand Up @@ -105,7 +106,7 @@ npm install -g http-server
Then, `cd` into your project directory and run the following command:

```node
http-server
http - server;
```

The output after entering the command provides the local URL where the preview can be accessed.
Expand Down
7 changes: 4 additions & 3 deletions docs/deployment/react.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
title: Use the Redoc React component
redirectFrom:
- /docs/redoc/quickstart/react/
redirects:
'/docs/redoc/quickstart/react/':
to: '/docs/redoc/deployment/react/'
---

# How to use the Redoc React component
Expand Down Expand Up @@ -71,7 +72,7 @@ is fully rendered or when an error occurs (with an error as the first argument).
```js
<RedocStandalone
specUrl="http://petstore.swagger.io/v2/swagger.json"
onLoaded={error => {
onLoaded={(error) => {
if (!error) {
console.log('Yay!');
}
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Redoc is provided as a CLI tool (also distributed as a Docker image), HTML tag,
If you have Node installed, quickly generate documentation using `npx`:

```
npx @redocly/cli build-docs openapi.yaml
npx @redocly/cli build-docs openapi.yaml
```

The tool outputs by default to a file named `redoc-static.html` that you can open in your browser.
Expand Down Expand Up @@ -56,7 +56,7 @@ Check out the [deployment documentation](./deployment/intro.md) for more options

Redoc is highly configurable. Each deployment option accepts configuration in a way that's appropriate to that platform, but the options are the same for each. For example:

* Using [Redocly CLI](../cli/index.mdx), configuration goes in the `redocly.yaml` file, or can be supplied as command line parameters, such as `--theme.openapi.disableSearch`.
* Using [Redocly CLI](../cli/index.md), configuration goes in the `redocly.yaml` file, or can be supplied as command line parameters, such as `--theme.openapi.disableSearch`.
* Using HTML or React, configure by setting `option` in the tag.

Here's a sample `redocly.yaml` configuration file, showing a few common settings and tweaking some of the visual theme settings:
Expand Down
6 changes: 2 additions & 4 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ replace the `spec-url` attribute with the URL or local file address to your defi
</html>
```

:::attention Redoc requires an HTTP server to run locally

{% admonition type="attention" name="Redoc requires an HTTP server to run locally" %}
Loading local OpenAPI definitions is impossible without running a web server because of issues with
[same-origin policy](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) and
other security reasons. Refer to [Running Redoc locally](./deployment/intro.md#how-to-run-redoc-locally) for more information.

:::
{% /admonition %}

For a more detailed explanation with step-by-step instructions and additional options for using Redoc, refer to the [Redoc deployment guide](./deployment/intro.md).

0 comments on commit 75065a2

Please sign in to comment.