1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/website
Thomas Heartman 14e052b9ac
docs: auto-generate remaining server-side SDK docs (#2858)
This PR builds on the preceding doc auto-generation PRs and generates
documentation for the remaining server-side SDKs.

## Why

Refer to https://github.com/Unleash/unleash/pull/2809 for more context
about generating SDK docs.

## What

-   Adds generation for the remaining server-side SDKs
- Moves generated docs from the `/reference/sdks` directory to
`/generated` directory.
- Makes sure that the URLs do not change because of the move by using
the `slug` frontmatter property.
- replaces relative github links in the markdown documents so that they
become absolute github links. (refer to the next section)
- Updates some image styling so that it doesn't apply to readme badges
(we don't need them using `display: block`)

### On link replacing:

This PR adds handling of links in the generated documentation.
Specifically, it changes links in one case:

Relative links to github. Links to code and other files in the
repository. These are prefixed with the repository's URL.

While this should work in most cases, it will fail in cases where the
links to the files are not on the repository's primary branch.
(typically main, but could also be "v3", for instance). In these cases,
the links will get a double branch in the URL and will fail. However, I
see no easy way around this (though suggestions are definitely
accepted!), and think it's a fair tradeoff. It takes the links from
"definitely failing" to "will work in the vast majority of cases".

Note: I originally also wanted to handle the case where the link is an
absolute link to docs.getunleash.io. We could turn these into relative
urls to avoid full page reloads and enjoy a smoother experience.
However, the client-side redirects don't work correctly if the relative
URL goes to a redirect page, so you end up with a 404 page. As such, I
think it's better to leave the links as absolute for now.
2023-01-13 12:40:28 +01:00
..
.storybook docs(docs): document the use of AliasPlugin for theme resolution 2022-04-02 16:47:38 +02:00
docs docs: auto-generate remaining server-side SDK docs (#2858) 2023-01-13 12:40:28 +01:00
src docs: auto-generate remaining server-side SDK docs (#2858) 2023-01-13 12:40:28 +01:00
static docs: service accounts (#2881) 2023-01-13 09:46:50 +00:00
.gitignore Docs/public signup (#2070) 2022-10-10 16:12:11 +03:00
babel.config.js fix: rename websitev2 to website 2021-10-26 11:25:19 +02:00
clean-generated-docs.js chore: update docusaurus/openapi integration to stable version (#2414) 2022-11-14 08:52:46 +01:00
docusaurus.config.js docs: auto-generate remaining server-side SDK docs (#2858) 2023-01-13 12:40:28 +01:00
package.json docs: Use Go readme (#2816) 2023-01-05 09:47:49 +00:00
readme-fns.js docs: auto-generate remaining server-side SDK docs (#2858) 2023-01-13 12:40:28 +01:00
README.md fix: rename websitev2 to website 2021-10-26 11:25:19 +02:00
sidebars.js docs: auto-generate remaining server-side SDK docs (#2858) 2023-01-13 12:40:28 +01:00
tsconfig.json chore: convert feedback component to typescript 2022-03-02 10:50:46 +01:00
yarn.lock chore(deps): bump json5 from 1.0.1 to 1.0.2 in /website (#2815) 2023-01-11 14:31:30 +01: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.