Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs contribution guide #3261

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 26 additions & 35 deletions en/contribute/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Towards the end there is a basic style guide.
You will need a (free) [Github](https://github.com/) account to contribute to the guides.
:::

<a id="github_changes" ></a>

## Quick Changes in Github

Simple changes to _existing content_ can be made by clicking the **Edit on GitHub** link that appears at the bottom of every page (this opens the page on Github for editing).
Expand All @@ -26,8 +24,6 @@ To edit an existing page:

The documentation team will review the request and either merge it or work with you to update it.

<a id="big_changes" ></a>

## Changes using Git (New Pages and Images)

More substantial changes, including adding new pages or adding/modifying images, aren't as easy to make (or properly test) on Github.
Expand Down Expand Up @@ -174,19 +170,19 @@ In overview:
This might be revisited - there are some interesting options provided!
- This is a [multilingual](https://vitepress.dev/guide/i18n) book:
- Pages for each language are stored in the folder named for the associated language code (e.g. "en" for English, "zh" for Chinese, "ko" for Korean).
- Only edit the ENGLISH (**/en**) version of files.
- Only edit the ENGLISH (`/en`) version of files.
We use [Crowdin](../contribute/translation.md) to manage the translations.
- All pages must be in an appropriately named sub-folder of **/en** (e.g. this page is in folder **en/contribute/**).
- All pages must be in an appropriately named sub-folder of `/en` (e.g. this page is in folder `en/contribute/`).
- This makes linking easier because other pages and images are always as the same relative levels
- The _structure_ of the book is defined in **SUMMARY.md**
- The _structure_ of the book is defined in `SUMMARY.md`.

- If you add a new page to the guide you must also add an entry to this file!

:::tip
This is not "standard vitepress" way to define the sidebar (the summary file is imported by [.vitepress/get_sidebar.js](https://github.com/PX4/PX4-user_guide/blob/main/.vitepress/get_sidebar.js)).
:::

- Images must be stored in a sub folder of **/assets**.
- Images must be stored in a sub folder of `/assets`.
This is two folders down from content folders, so if you add an image you will reference it like:

```plain
Expand All @@ -198,51 +194,46 @@ In overview:

### Adding New Pages

When you add a new page you must also add it to **en/SUMMARY.md**!
When you add a new page you must also add it to `en/SUMMARY.md`!

## Style Guide

1. Files/file names

- Put new files in an appropriate sub-folder of **/en/**.
- Put new markdown files in an appropriate sub-folder of `/en/`, such as `/en/contribute/`.
Do not further nest folders.
- Use descriptive names.
In particular, image filenames should describe what they contain.
- Use lower case filenames and separate words using underscores "\_"
- Put new image files in an appropriate nested sub-folder of `/assets/`.
Deeper nesting is allowed/encouraged.
- Use descriptive names for folders and files.
In particular, image filenames should describe what they contain (don't name as "image1.png")
- Use lower case filenames and separate words using underscores (`_`).

2. Images

- Use the smallest size and lowest resolution that makes the image still useful (this reduces download cost for users with poor bandwidth).
- New images should be created in a sub-folder of **/assets/** by default (so they can be shared between translations).
- New images should be created in a sub-folder of `/assets/` (so they can be shared between translations).
- SVG files are preferred for diagrams.
PNG files are preferred over JPG for screenshots.

3. Content:

- Use "style" \(bold, emphasis, etc\) consistently.
- Use "style" (**bold**, _emphasis_, etc.) consistently and sparingly (as little as possible).
- **Bold** for button presses and menu definitions.
- _Emphasis_ for tool names. - Otherwise use as little as possible.
- Headings and page titles should use "First Letter Capitalisation"
- The page title should be a first level heading \(\#\).
All other headings should be h2 \(\#\#\) or lower.
- _Emphasis_ for tool names such as _QGroundControl_ or _prettier_.
- `code` for file paths, and code, parameter names that aren't linked, using tools in a command line, such as `prettier`.
- Headings and page titles should use "First Letter Capitalisation".
- The page title should be a first level heading (`#`).
All other headings should be h2 (`##`) or lower.
- Don't add any style to headings.
- Don't translate the _first part_ of a note, tip or warning declaration (e.g. `::: tip`)
as this precise text is required to render the note properly.
- Don't translate the _first part_ of an `info`, `tip` or `warning` declaration (e.g. `::: tip`) as this precise text is required to render the note properly.
- Break lines on sentences by preference.
Don't break lines based on some arbitrary line length.
- Format using _prettier_ (_VSCode_ is a has extensions can be used for this).

## Where Do I Add Changes?

Add new documentation in-line with the existing structure!

Some of the main categories are:

- Development: content related to:
- Evolving the platform (new modes, modules, flight modes, hardware, software and hardware architecture and porting).
- "Experimental" work that requires developer expertise to reproduce.
- Flying: content related to flying a standard vehicle (flight modes, arming, taking off, landing)
- Basic configuration: Configuration that every vehicle will need to do
- Advanced configuration: Configuration that is specific to a vehicle type, or some segment of users.
- Peripherals: Documentation on different hardware that can be used.
- This also includes setup and configuration information for hardware that isn't covered in Basic configuration.
- Basic Assembly: Assembly of an autopilot and its main peripherals
- Airframe Builds: Examples of how to build a whole system.
Add new files in folders that cover similar topics.
Then reference them in the sidebar (`/en/SUMMARY.md`) in line with the existing structure!

## Translations

Expand Down
Loading