1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/website/sidebars.js
Thomas Heartman 7cff6336c1
docs: Use Go readme (#2816)
# PR 1: add remote content plugin and rust readme

## What

This PR does a few connected things:

1. It adds the ["docusaurus-plugin-remote-content" package](https://github.com/rdilweb/docusaurus-plugin-remote-content).

2. It adds configuration to make it work with Readmes found on GitHub.

3. It adds the Rust SDK's readme (replacing the link we used to have) as a proof of concept on how to do it.

## Why

With documentation split between GitHub readmes and the official docs, it's hard to keep everything up to date and in sync. It's also quite confusing that some information is only available in some places, but not in others. 

We've talked about auto-including readmes from GitHub for a while, so here's a proof of concept (finally) 🥳 

The intention is to get this merged and then to migrate the other SDK docs one by one, ensuring that everything in the documentation is also in the readme (so that no info is lost). 

## Discussion points

### Generation directory

The current generation method generates the files into `/reference/sdks/<sdk name>`. I think this works for now, but it means it adds auto-generated files into a directory that you can't ignore (at least not yet). 

We could instead generate them into `/generated/sdks` and update the slugs so that they still match the expected pattern. 

However, this would make the sidebar a little harder to work with (for now). That said, there may be ways around it. It's worth exploring.

### Generation method

By default, this plugin will generate files whenever you build. That (probably) means that you need an internet connection _and_ that you'll end up with a bunch of untracked files.

An option is to only generate the files "manually" and commit them to the repo. That would allow you to build the project without an internet connection and would also remove the need for ignoring the files. We could automate the generation if we wanted to. 

## Preview / Screenies

Visit [/reference/sdks/rust](https://unleash-docs-git-docs-include-sdk-readmes-unleash-team.vercel.app/reference/sdks/rust) in the preview to see what it looks like live. 

![image](https://user-images.githubusercontent.com/17786332/210373446-784b7e69-0f36-4e9e-874a-2b06b863b603.png)

# PR 2: add go readme

This PR changes the docs generation to use the Go SDK's GitHub readme
for the SDK docs instead of a separate document.

## What

The changes in this PR are:

- Delete the existing Go SDK documentation. All the content in this
guide already exists in the Go readme.
-   Add the Go SDK to the list of auto-generated readme docs
- Move the readme-related code into a separate module, `readme-fns.js`
(I'm not bullish about the file name: we can change it if you have
suggestions)
- Add a note to the top of all generated readmes saying you'll need an
API url and an API token. The note also links you to the relevant
reference and how-to docs.

## Why

Having two different bits of documentation for the same SDK is
troublesome. By only having the data in one place, we can avoid it going
out of sync and getting stale.
2023-01-05 09:47:49 +00:00

370 lines
16 KiB
JavaScript

/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
module.exports = {
documentation: [
'about-the-docs',
{
label: 'First steps and tutorials',
type: 'category',
collapsed: false,
link: {
type: 'generated-index',
title: 'First steps',
description: 'Learn how and where to get started with Unleash.',
slug: '/tutorials',
},
items: [
'tutorials/unleash-overview',
'tutorials/important-concepts',
'tutorials/quickstart',
],
},
{
label: 'Topic guides',
collapsed: false,
type: 'category',
link: {
type: 'generated-index',
title: 'Topic guides',
description:
'Discussions, explanations, and explorations regarding topics related to Unleash.',
slug: '/topics',
},
items: [
'topics/the-anatomy-of-unleash',
'topics/a-b-testing',
'topics/proxy-hosting',
],
},
{
label: 'How-to guides',
collapsed: false,
type: 'category',
link: {
type: 'generated-index',
title: 'How-to guides',
description: 'Step-by-step recipes for you to follow.',
slug: '/how-to',
},
items: [
{
type: 'category',
link: {
type: 'generated-index',
title: 'How-to: Unleash API',
description: 'Learn how to work with the Unleash API',
slug: '/how-to/api',
},
label: 'Unleash API guides',
items: [
'how-to/how-to-create-api-tokens',
'how-to/how-to-create-personal-access-tokens',
'how-to/how-to-use-the-admin-api',
'how-to/how-to-enable-openapi',
],
},
{
type: 'category',
link: {
type: 'generated-index',
title: 'How-to: The Unleash Proxy',
description: 'Learn how to work with the Unleash Proxy',
slug: '/how-to/proxy',
},
label: 'Unleash Proxy guides',
items: ['how-to/how-to-run-the-unleash-proxy'],
},
{
label: 'Feature toggles, strategies, context',
items: [
'how-to/how-to-add-strategy-constraints',
'how-to/how-to-capture-impression-data',
'how-to/how-to-create-feature-toggles',
'how-to/how-to-define-custom-context-fields',
'how-to/how-to-use-custom-strategies',
'how-to/how-to-schedule-feature-releases',
],
type: 'category',
link: {
type: 'generated-index',
title: 'How-to: general Unleash tasks',
description:
'Guides for how to perform general Unleash tasks.',
slug: '/how-to/misc',
},
},
{
label: 'Environments',
items: ['how-to/how-to-clone-environments'],
type: 'category',
link: {
type: 'generated-index',
title: 'How-to: environments',
description: 'Environments how-to guides.',
slug: '/how-to/env',
},
},
{
label: 'Users and permissions',
items: [
'how-to/how-to-add-users-to-unleash',
'how-to/how-to-create-and-assign-custom-project-roles',
'how-to/how-to-create-and-manage-user-groups',
'how-to/how-to-set-up-group-sso-sync',
],
type: 'category',
link: {
type: 'generated-index',
title: 'How-to: users and permissions',
description: 'Users and permission how-to guides.',
slug: '/how-to/users-and-permissions',
},
},
{
label: 'Single Sign-On (SSO)',
items: [
'how-to/how-to-add-sso-open-id-connect',
'how-to/how-to-add-sso-saml',
'how-to/how-to-add-sso-saml-keycloak',
'how-to/how-to-add-sso-google',
'how-to/how-to-setup-sso-keycloak-group-sync',
],
type: 'category',
link: {
type: 'generated-index',
title: 'How-to: Single Sign-On',
description: 'Single Sign-On how-to guides.',
slug: '/how-to/sso',
},
},
,
],
},
{
label: 'Reference documentation',
collapsed: false,
type: 'category',
link: {
type: 'generated-index',
title: 'Reference documentation',
description:
'Technical reference documentation relating to Unleash, including APIs, SDKs, Unleash concepts and deployment.',
slug: '/reference',
},
items: [
{
type: 'category',
link: { type: 'doc', id: 'reference/addons/index' },
items: [
'reference/addons/datadog',
'reference/addons/slack',
'reference/addons/teams',
'reference/addons/webhook',
],
label: 'Addons',
},
{
type: 'category',
link: {
type: 'doc',
id: 'reference/api/legacy/unleash/index',
},
label: 'APIs',
items: [
{
'Admin API': [
'reference/api/legacy/unleash/admin/addons',
'reference/api/legacy/unleash/admin/context',
'reference/api/legacy/unleash/admin/events',
'reference/api/legacy/unleash/admin/features-v2',
'reference/api/legacy/unleash/admin/feature-types',
'reference/api/legacy/unleash/admin/features',
'reference/api/legacy/unleash/admin/archive',
'reference/api/legacy/unleash/admin/metrics',
'reference/api/legacy/unleash/admin/projects',
'reference/api/legacy/unleash/admin/segments',
'reference/api/legacy/unleash/admin/state',
'reference/api/legacy/unleash/admin/strategies',
'reference/api/legacy/unleash/admin/tags',
'reference/api/legacy/unleash/admin/user-admin',
],
'Client API': [
'reference/api/legacy/unleash/client/features',
'reference/api/legacy/unleash/client/metrics',
'reference/api/legacy/unleash/client/register',
],
'System API': [
'reference/api/legacy/unleash/internal/prometheus',
'reference/api/legacy/unleash/internal/health',
],
},
{
label: 'OpenAPI docs',
collapsed: true,
type: 'category',
link: {
title: 'Unleash Server APIs',
type: 'generated-index',
description:
'Generated API docs based on the Unleash OpenAPI schema. For the time being, some additional info can also be found in the older API docs.',
slug: '/reference/api/unleash',
},
items: require('./docs/reference/api/unleash/sidebar.js'),
},
],
},
{
type: 'category',
label: 'Application SDKs',
link: { type: 'doc', id: 'reference/sdks/index' },
items: [
{
type: 'category',
label: 'Server-side SDKs',
items: [
'reference/sdks/go',
'reference/sdks/java',
'reference/sdks/node',
'reference/sdks/php',
'reference/sdks/python',
'reference/sdks/ruby',
'reference/sdks/rust',
'reference/sdks/dotnet',
],
},
{
type: 'category',
label: 'Client-side SDKs',
items: [
'reference/sdks/android-proxy',
'reference/sdks/flutter',
'reference/sdks/ios-proxy',
'reference/sdks/javascript-browser',
'reference/sdks/react',
'reference/sdks/svelte',
'reference/sdks/vue',
],
},
{
type: 'link',
label: 'Community SDKs',
href: '/reference/sdks#community-sdks',
},
],
},
{
type: 'category',
link: {
type: 'generated-index',
title: 'Deployment and management of Unleash',
description:
'All you need to learn how to deploy and manage your own Unleash instance.',
slug: '/reference/deploy',
},
label: 'Deploy and manage Unleash',
items: [
'reference/deploy/getting-started',
'reference/deploy/configuring-unleash',
'reference/deploy/database-setup',
'reference/deploy/database-backup',
'reference/deploy/email-service',
'reference/deploy/google-auth-hook',
'reference/deploy/import-export',
'reference/deploy/migration-guide',
'reference/deploy/securing-unleash',
],
},
{
type: 'category',
label: 'Integrations',
link: {
type: 'doc',
id: 'reference/integrations/integrations',
},
items: [
{
'Jira Server': [
'reference/integrations/jira-server-plugin-installation',
'reference/integrations/jira-server-plugin-usage',
],
},
,
],
},
{
type: 'category',
link: {
type: 'generated-index',
title: 'Unleash concepts',
description:
'Documents describing the inner parts of Unleash.',
slug: '/reference/concepts',
},
label: 'Unleash concepts',
items: [
'reference/activation-strategies',
'reference/api-tokens-and-client-keys',
'reference/archived-toggles',
'reference/event-log',
'reference/impression-data',
'reference/custom-activation-strategies',
'reference/environments',
'reference/feature-toggles',
'reference/feature-toggle-types',
'reference/feature-toggle-variants',
'reference/front-end-api',
'reference/playground',
'reference/public-signup',
'reference/projects',
'reference/rbac',
'reference/segments',
'reference/sso',
'reference/stickiness',
'reference/strategy-constraints',
'reference/tags',
'reference/technical-debt',
'reference/unleash-context',
'reference/unleash-proxy',
'reference/change-requests',
],
},
],
},
{
label: 'Developer contribution docs',
type: 'category',
collapsed: true,
link: {
type: 'generated-index',
title: 'Developer Guide',
description: 'Learn how to contribute to unleash.',
slug: '/developer-guide',
},
items: [
'contributing/developer-guide',
'contributing/frontend/overview',
'contributing/backend/overview',
{
type: 'category',
label: 'Architectural Decision Records',
items: [
{
type: 'autogenerated',
dirName: 'contributing/ADRs', // '.' means the current docs folder
},
],
},
],
},
],
};