- Node.js version 16.14 or above (which can be checked by running
node -v). You can use nvm for managing multiple Node versions on a single machine installed.- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
- Fork the repo.
- Clone the forked repo to your local machine.
- Run
yarnin the directory. - Run
yarn startto view the documentation locally.
We want to keep our documentation consistent in styling. More details could be found here.
-
All documentation markdown files are located within
./docs/. -
Every documentation markdown file should have the front matter. You should have required
title,description, and an optionalsidebar_label. Please see the example below:--- title: Workflow Sample - Authentication sidebar_label: Authentication description: a summary of the page to provide better text snippet in the search result. This is for SEO purpose. ----
titleis theh1heading that shows on the HTML page. -
sidebar_labelis the title you want to show in the sidebar navigation. If it is not included:- the label in sidebars.js for the file will be used.
- the title in front matter will be used if the label doesn't exist.
An exception exists for folders' index page or pages in sidebars.js with type
category. Thelabelfield is required (instead of optional) in sidebars.js and will take priority oversidebar_label. Examples include:add-functionality/add-functionality.md,support-for-different-authentication-environments/support-for-different-authentication-environments.md. -
descriptionis the summary for this page. It provides better text snippet in the search result. This is only for SEO purpose.
Note: Don't use backticks in front matter. The text won't be surrounded by code background effect.
-
This is all based on the ordering in sidebars.js file.
There are three main ways to add your new doc into the sidebar:
-
If you don't mind the
titleandsidebar_labelare the same, you can directly addidof your doc insidebars.js. Theidis the file path from/docsfolder. For example,add-functionality/add-nav. -
If you only want to modify the
sidebar_labelvalue, you can use the code snippet below:
{
"type": "doc",
"id": "whats-new",
"label": "What's new" // The sidebar's label value
}- If the doc is the index of the section or folder, you can use the code snippet below:
{
"type": "category",
"link": {
"type": "doc",
"id": "support-for-different-authentication-environments/support-for-different-authentication-environments"
},
"label": "Support for different authentication environments",
"items": [
"support-for-different-authentication-environments/guest-authentication-mode-only",
"support-for-different-authentication-environments/multiple-modes",
"support-for-different-authentication-environments/authentication-saml",
"support-for-different-authentication-environments/authentication-custom"
]
}-
If you want to update an existing doc, the versioned docs locate in
/versioned_doc, the current docs locate in/docs. -
If you want to delete an existing version, you need to perform three steps:
- Remove the version from
versions.json. - Delete the versioned docs directory. Example:
versioned_docs/version-1.0.0. - Delete the versioned sidebars file. Example:
versioned_sidebars/version-1.8.0-sidebars.json
- Remove the version from
More information could be found in sidebars.js or in the "Sidebar" section of the Docusaurus official documentation.
Run yarn run docusaurus docs:version VERSION_NAME to tag a new version.
Detailed information can be found on Docusaurus Docs.
You can run yarn start to test your local changes. Make sure everything looks okay before creating a Pull Request.
You can also run yarn lint before committing to make sure no errors exist. If errors exist, try to run yarn lint:fix to auto fix some of the errors for you. If the errors cannot be auto fixed, please fix the error manually based on the terminal logs.
When you try to commit your changes, yarn eslint --quiet, yarn prettier --list-different, and yarn markdownlint will be run in sequence for the staged files only. If any error is detected, the commit will fail. You need to follow the error messages and suggestions of changes to fix all the errors before committing them.
Some helpful commands are available to help you auto fix some of the errors:
yarn lint:eslint:fixcan auto fix eslint related errors.yarn lint:prettier:fixcan auto fix prettier related errors.yarn lint:markdownlint:fixcan auto fix markdownlint related errors.
When you finish making changes, and you'd like to propose them for review, fill up the pull request template to open your PR (pull request). You can find more detail on creating a PR in the official GitHub documentation here.