How to contribute docs
Starting from version 1.3, the community documentation will be available on the Karmada 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 we have 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.
- For our docs we 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 our 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.
Writing docs
Starting a title at the top
It's important for your article to specify metadata concerning an article at the top of the Markdown file, in a section called Front Matter.
For now, let's take a look at a quick example which should explain the most relevant entries in Front Matter:
---
title: A doc with tags
---
## secondary title
The top section between two lines of --- is the Front Matter section. Here we define a couple of entries which tell Docusaurus how to handle the article:
- Title is the equivalent of the
<h1>
in a HTML document or# <title>
in a Markdown article. - Each document has a unique ID. By default, a document ID is the name of the document (without the extension) related to the root docs directory.