From 84ce2c1df2bbb51a4cefd6b2adf1ad8b443bb0f1 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 18 Apr 2021 17:25:03 +0200 Subject: [PATCH] website: separate development docs Signed-off-by: Jens Langhammer --- .../development => developer-docs}/api.md | 4 ++-- .../local-dev-environment.md | 9 +++++++- website/docusaurus.config.js | 23 +++++++++++++++++++ website/sidebars.js | 8 ------- website/sidebarsDev.js | 12 ++++++++++ 5 files changed, 45 insertions(+), 11 deletions(-) rename website/{docs/development => developer-docs}/api.md (67%) rename website/{docs/development => developer-docs}/local-dev-environment.md (82%) create mode 100644 website/sidebarsDev.js diff --git a/website/docs/development/api.md b/website/developer-docs/api.md similarity index 67% rename from website/docs/development/api.md rename to website/developer-docs/api.md index 6255991db..25e41ebe1 100644 --- a/website/docs/development/api.md +++ b/website/developer-docs/api.md @@ -6,6 +6,6 @@ Starting with 2021.3.5, every authentik instance has a built-in API browser, whi To generate an API client, you can use the Swagger schema at https://authentik.company/api/v2beta/swagger.json. -While testing, the API requests are authenticated by your browser session. To send an API request from outside the browser, you need to set an `Authorization` header. +While testing, the API requests are authenticated by your browser session. -The value needs to be set to the base64-encoded token key. +To send an API request from outside the browser, you need to set the `Authorization` Header to `Bearer `. diff --git a/website/docs/development/local-dev-environment.md b/website/developer-docs/local-dev-environment.md similarity index 82% rename from website/docs/development/local-dev-environment.md rename to website/developer-docs/local-dev-environment.md index ca2770605..771570e65 100644 --- a/website/docs/development/local-dev-environment.md +++ b/website/developer-docs/local-dev-environment.md @@ -1,5 +1,6 @@ --- -title: Setting up a local dev environment +title: Getting started +slug: / --- ## Backend @@ -27,6 +28,10 @@ Afterwards, you can start authentik by running `./manage.py runserver`. Generall Most functions and classes have type-hints and docstrings, so it is recommended to install a Python Type-checking Extension in your IDE to navigate around the code. +Before committing code, run `make lint` to ensure your code is formatted well. This also requires `pyright`, which can be installed with npm. + +Run `make gen` to run all unittests and generated an updated swagger document for any changes you made. + ## Frontend By default, no transpiled bundle of the frontend is included. To build the UI, you need Node 12 or newer. @@ -54,3 +59,5 @@ npm run build ``` If you want to make changes to the UI, run `npm run watch` instead. + +To ensure the code is formatted well, run `npx eslint . --fix` and `npm run lit-analyse`. diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index c60f9e09a..2bbde1b17 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -21,6 +21,12 @@ module.exports = { label: "Docs", position: "left", }, + { + to: "developer-docs/", + activeBasePath: "developer-docs", + label: "Developer Docs", + position: "left", + }, { to: "api/", activeBasePath: "api", @@ -48,6 +54,10 @@ module.exports = { label: "Documentation", to: "docs/", }, + { + label: "Developer Documentation", + to: "developer-docs/", + }, { label: "Installations", to: "docs/installation/index", @@ -83,6 +93,7 @@ module.exports = { "@docusaurus/preset-classic", { docs: { + id: "docs", sidebarPath: require.resolve("./sidebars.js"), editUrl: "https://github.com/beryju/authentik/edit/master/website/", }, @@ -92,4 +103,16 @@ module.exports = { }, ], ], + plugins: [ + [ + '@docusaurus/plugin-content-docs', + { + id: 'docsDevelopers', + path: 'developer-docs', + routeBasePath: 'developer-docs', + sidebarPath: require.resolve('./sidebarsDev.js'), + editUrl: "https://github.com/beryju/authentik/edit/master/website/", + }, + ], + ], }; diff --git a/website/sidebars.js b/website/sidebars.js index d96459aa9..d3180b176 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -163,13 +163,5 @@ module.exports = { "troubleshooting/image_upload_backup", ], }, - { - type: "category", - label: "Development", - items: [ - "development/local-dev-environment", - "development/api" - ], - }, ], }; diff --git a/website/sidebarsDev.js b/website/sidebarsDev.js new file mode 100644 index 000000000..301d1228a --- /dev/null +++ b/website/sidebarsDev.js @@ -0,0 +1,12 @@ +module.exports = { + docs: [ + { + type: "doc", + id: "local-dev-environment", + }, + { + type: "doc", + id: "api", + }, + ], +};