Skip to main content

Writing Conventions

Table of contents and page structure​

1.1 Catalogue organization​

  • Put the same subject under the same directory as possible, and the directory name corresponds to the sidebar classification
  • Pictures/annexes in a document are as much as possible in the same directory as the document (or in the directory of the document) assets/ in subdirectories)
  • Avoid stacking a large amount of irrelevant content in a "full": split into searchable shorts

Recommended directory template (example):

docs/
develop/
intro.md
message/
xxx.md
assets/
xxx.png
edit-guide/
intro.md
xxx1.md
xxx2.md
Recommendation

From the " transportability " point of view, the picture/annex follows as much as possible the document in the same directory or directory assets/ , this is not easily broken when moving/reconstructing a directory.

1.2 Title level​

  • Only one for each document # As Page Title
  • Chapter from ## Start, if necessary ### / ####
  • The title is as much as possible a " dynamic structure " or " question sentence ", which facilitates search (e.g. " How to Enable XXX ")

1.3 Indexes​

The index to the sidebar of the document system is automatically generated, and the document catalogue is the index page. For a directory:

  • Set index display name (label)/ sorting (position)
  • Generate Index Pages for this directory (pages entered when clicking on the classification title)

You can add new entries to this directory _category_.json.

Example (repository written, reference) docs/develop/message/_category_.json):

{
"label": "内核自定义",
"position": 3,
"link": {
"type": "generated-index",
"description": "这里填写该目录内容概述(用于索引页展示与检索)"
}
}

Applys the scenario: There are multiple documents under the table of contents, and it is hoped that the index page will automatically list the sub-pages with a brief introduction.

1.3.2 Specify index documents (linking classification headings to a document)​

If you want the "Class Title" to open a handwritten introduction page, it is suggested to create a new one under the directory intro.md(or) index.md) And then in _category_.json Use doc Other Organiser

{
"label": "消息",
"position": 1,
"link": {
"type": "doc",
"id": "develop/message/intro"
}
}

of which id Doc ID for document (usually relative) docs/ path to remove the extension. To make ID more stable, it is proposed to use English filenames (e. g. intro.md) avoids renaming leading to extensive linkage adjustments.

Recommendation

Top-level directories such as docs/develop/ and docs/lps_online/, as well as their subdirectories, can contain _category_.json. If the directory is mainly a " chapter ", use generated-index Minimum maintenance; if the directory requires a long guide, use doc More flexible.

Markdown/MDX writing requirements​

2.1 Basic layout​

  • Empty line between paragraphs
  • List items keep the same style (all used) - Or all. 1.)
  • It is suggested that spaces be left between Chinese and English/digits (e. g. "Support 3 modes")
  • For the first time a proprietary term appears giving an explanation or link in Chinese

2.2 Code blocks​

  • Language (highlight and readability) must be indicated, for example:
npm run start
export default config;
  • An example of a command line suggests the use of a genuine enforceable order to avoid a "false order"
  • Configure clips to be as available as possible; comments to be omitted Points

2.3 Plugins (admonitions)​

To emphasize attention, risk, best practices:

Recommendation

Gives priority to a copyable command or configuration session.

Attention.

Where changes in the production environment are involved, the rollback method and impact must be clearly stated.

Risk

Do not paste real keys, tokens, Intranet sensitive addresses in the document.

2.4 Mathematical Formula (KaTeX)​

This document system has enabled the support of the KaTex syntax formula:

  • Line formula: $E=mc^2
  • Block formula:
Δp=λLDρv22\Delta p = \lambda \frac{L}{D}\frac{\rho v^2}{2}

2.5 Flowcharts and charts (Mermaid)​

The Mermaid support is enabled in this document system to create multiple charts using code blocks, such as flow charts, time charts, Gant charts, etc.

2.5.1 Basic use​

Use mermaid Language-marked code blocks allow the drawing of charts:

```mermaid
graph LR
A [start] --> B [process]
B -- > C [concluded]
```

2.5.2 Common chart type​

Flowchart

Sequence Diagram

Status Diagram

Gantt Chart

2.5.3 Preparation of recommendations​

Best practices
  • Node Naming Clear: Use Chinese or meaningful English logo to avoid meaningless designations such as A/B/C
  • Simplified process: complex process can be split into multiple sub-graphs, individual graphs controlled in 10 nodes Internal
  • Direction selection: horizontal process use LR(Left to Right), vertically TD(Top Down)
  • Comment added: Key nodes may be quoted with a detailed description
Notes
  • Mermaid syntax is sensitive toindent, taking note of consistent indentation (recommendation 4 spaces)
  • The Chinese label needs square brackets [] Package
  • Special characters (e.g. quotation marks, brackets) may need to be converted or packaged with quotation marks
  • A complicated chart suggests first. Mermaid Live Editor Paste After Preview

2.5.4 Additional resources​

3. Pictures, illustrations and dimensions​

3.1 Photo placement and naming​

  • Put the picture in the directory and move it with the document. Heart
  • When more pictures of the same theme are available, it is recommended that they be placed in the subject directory. assets/ Subdirectories
  • Suggested semanticization of filenames (e.g. pipeline-overview.png, ui-setting-panel.png)
  • Avoid Usage 截图(1).png, image.png Such unreadable names

Suggested additional constraints:

  • Do not refer pictures across directories: avoid as much as possible ../ Quote pictures from other directories to reduce the number of broken links during re-engineering
  • Priority relative path references: for example ![说明](./assets/xxx.png) or ![说明](./xxx.jpg)
  • Compression before subtask: interface screenshot priority PNG, photo/big map priority JPG; as much volume as possible without significant impact clarity

3.2 Must Write Alt​

All pictures must contain readable att (accessible and search friendly):

![用户在工作台创建工程的入口](./workbench-entry.png)

3.3 Figure and figure​

When a paragraph contains only images, each image gets a caption from its alt text and a link to the full-size image.

The recommended writing (alt is both an accessible text and annotation):

![工作台工程入口](./workbench-entry.png)

3.4 Picture sizes (optional)​

Body images preserve their aspect ratio and fit within 800 px wide and 640 px tall, adapting to narrow screens. Small images retain their native size.

Append =<width>x<height> to alt text for an individual override. When both dimensions are specified, the image fits within those bounds without stretching.

  • Only width (high self-adaptation):
![工作台工程入口=640x](./workbench-entry.png)
  • Set width height:
![工作台工程入口=640x360](./workbench-entry.png)
Attention.

=640x Such size marks are used only to control the size of the display and do not compress the size of the picture; large maps are self-compressed before subtask.

Linking norms​

  • In-station links are preferred to the relative path (more transportable/reconstructive):[模板](./模板与示例.md)
  • Point docs/ , with absolute paths:/docs/...(consistent with existing documents)
  • The outer chain must be used. https://, and link as much as possible to a stable page (official document/version description)

5. File naming and meta-information (front matter)​

5.1 File Naming​

There are a number of Chinese filenames in the warehouse that allow for continued use; however, it is recommended that:

  • File name readable, searchable (e.g. " Introductory case.md " is better than " Document 1.md ")
  • Avoid confusion with the same/approximate file under the directory

Each document recommends at least:

---
sidebar_position: 10
title: 页面标题
---

Add when stronger search is needed description, but do not stack keywords.

6. Quality of content and checklist​

Self-check before submitting:

  • The title and paragraph are structured so that the reader can locate the key steps in 30 seconds.
  • Code blocks can be copied, run (at least certified locally)
  • Picture alt complete, key screenshot with explanatory text
  • Site links are clickable and no 404
  • Avoid sensitive information (account number, token, Intranet IP, client data)