版本:v2.4.1
How to contribute docs
Starting from version 1.3, the community documentation will be available on the HAMi website.
This document explains how to contribute docs to
the Project-HAMi/website repository.
Prerequisites
- Docs, like codes, are also categorized and stored by version. 1.3 is the first version is the first archived.
- Docs need to be translated into multiple languages for readers from different regions. The community now supports both Chinese and English. English is the official language of documentation.
- The docs use markdown. If you are unfamiliar with Markdown, please see https://guides.github.com/features/mastering-markdown/ or https://www.markdownguide.org/ if you are looking for something more substantial.
- We get some additions through Docusaurus 2, a model static website generator.
Setup
You can set up your local environment by cloning the website repository.
git clone https://github.com/Project-HAMi/website.git
cd website
Our website is organized like below:
website
├── sidebars.json # sidebar for the current docs version
├── docs # docs directory for the current docs version
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
│ └── hello.md # https://mysite.com/docs/next/hello
├── versions.json # file to indicate what versions are available
├── versioned_docs
│ ├── version-1.1.0
│ │ ├── foo
│ │ │ └── bar.md # https://mysite.com/docs/foo/bar
│ │ └── hello.md
│ └── version-1.0.0
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/1.0.0/foo/bar
│ └── hello.md
├── versioned_sidebars
│ ├── version-1.1.0-sidebars.json
│ └── version-1.0.0-sidebars.json
├── docusaurus.config.js
└── package.json
The versions.json file is a list of versions, from the latest to earliest.
The table below explains how a versioned file maps to its version and the generated URL.
| Path | Version | URL |
|---|---|---|
versioned_docs/version-1.0.0/hello.md | 1.0.0 | /docs/1.0.0/hello |
versioned_docs/version-1.1.0/hello.md | 1.1.0 (latest) | /docs/hello |
docs/hello.md | current | /docs/next/hello |
提示
The files in the docs directory belong to the current docs version.
The current docs version is labeled as Next and hosted under /docs/next/*.
Contributors mainly contribute documentation to the current version.