1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00
unleash.unleash/website
Thomas Heartman 0a99dfd6e3
#1391: add generated doc cleaning script (#2077)
* #1391: add generated doc cleaning script

## What

The cleaning script replaces all references to the Unleash ushosted instance in the
generated OpenAPI docs. It removes extra path segments (such as leading
`/ushosted` instances) and replaces the ushosted base url with something
user-agnostic.

## Why

When we host the OpenAPI docs in our official documentation, the generated
docs shouldn't necessarily point at _one specific instance_, and especially
not one that the reader is unlikely to ever use. Instead, we can remove all
the bits that are specific to the generation source we use, and make the docs
easier to use. In particular, removing the leading `/ushosted` is likely to
save us loooots of questions.

* #1391: change env var used for generating openapi from localhost

Using NODE_ENV=development doesn't necessarily make sense, so adding
an extra variable sounds reasonable to me.

* #1391: ensure that all generation commands also clean docs

* #1391: change <your-unleash-instance-url> to <your-unleash-url>

* #1391: fix ushosted replacement: not all paths start with /api

* #1391: chore: remove potential `ushosted` ending of api url

In the event that we change the base URL of OpenAPI, so that paths
don't start with `/ushosted/`, the script should still work, changing
those paths into <your-unleash-url> too.

Additionally, remove all instances of `/ushosted` that we find. In the
event that some things switch around or whatever.
2022-09-20 12:43:39 +02:00
..
.storybook docs(docs): document the use of AliasPlugin for theme resolution 2022-04-02 16:47:38 +02:00
docs docs: fix broken link to how-to-create-API token guide (#2073) 2022-09-19 13:18:44 +02:00
src Add OpenAPI docs (#1391) (#2066) 2022-09-19 14:50:24 +02:00
static Docs: update API access for new token type (#1958) 2022-09-15 09:02:10 +02:00
.gitignore Add OpenAPI docs (#1391) (#2066) 2022-09-19 14:50:24 +02:00
babel.config.js
clean-generated-docs.js #1391: add generated doc cleaning script (#2077) 2022-09-20 12:43:39 +02:00
docusaurus.config.js #1391: add generated doc cleaning script (#2077) 2022-09-20 12:43:39 +02:00
package.json #1391: add generated doc cleaning script (#2077) 2022-09-20 12:43:39 +02:00
README.md
sidebars.js Add OpenAPI docs (#1391) (#2066) 2022-09-19 14:50:24 +02:00
tsconfig.json
yarn.lock #1391: add generated doc cleaning script (#2077) 2022-09-20 12:43:39 +02:00

Website

This website is built using Docusaurus 2, a modern static website generator.

Installation

yarn install

Local Development

yarn start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

yarn build

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.