plugins/woocommerce/client/blocks/docs/contributors/documentation-guidelines.md
Active voice should be preferred over passive voice. Passive voice can be used, when it fits better.
When using active voice, the second person singular (you) must be used.
Gendered pronouns (she/her/hers and he/him/his) must not be used.
The filename of the document must match the title.
Correct H1-H6 headings must be used. Each document can only have one H1 heading. An H3 heading can only be used within an H2 heading, an H4 heading can only be used within an H3 heading, etc. If possible, avoid using articles in headings.
The markup used must be semantically correct, e.g. list markup must only be used to display a list.
Classes and tokens from the codebase must be written exactly as they appear in the codebase. Proper nouns must be written correctly.
p and the i of RestApi are written in lowercaseC of Composer is written in uppercase.E, the S and the L of ESLint are written in uppercase.Embedded images should not exceed a width of 50%.
When linking to another document, a descriptive link text must be used.
When listing or describing arguments, a table must be used to describe them. Refer to them as either arguments or props, depending on if they’re being used on a component or in a function/method. In the table, the description column should begin with a capital letter and end in a full stop. When listing an argument that is an array/object, list the argument name, type: array/object and a high-level description of what the purpose of the argument is. Then below, you detail the individual keys of the array/object.
| Argument | Type | Default value | Required | Description |
|---|---|---|---|---|
| ... | ... | ... | ... | ... |
When using code examples, the fence format and the language definition must be used.
```css
/* This will apply to prices in the checkout block */
.wc-block-checkout .wc-block-components-formatted-money-amount {
font-style: italic;
}
```
```js
const { registerExpressPaymentMethod } = window.wc.blocksRegistry;
```
In code examples, use imports from the global window object rather than the aliases, since the aliases require build tools to work. Example:
-import { registerCheckoutFilters } from '@woocommerce/blocks-checkout';
+const { registerCheckoutFilters } = window.wc.blocksCheckout;
Every top-level README must have a table of contents. The table of contents can be generated automatically using the Visual Studio Code extension Markdown All in One.
When listing features and options, e.g. ExperimentalOrderMeta, a table of contents with internal links must be used to allow jumping to the specific feature and option directly.
Releases must be sorted starting with the most recent release.
When explaining functionality, the following structure should be used:
When referencing other documentations, the corresponding document should be linked.
<!-- FEEDBACK -->We're hiring! Come work with us!
🐞 Found a mistake, or have a suggestion? Leave feedback about this document here.
<!-- /FEEDBACK -->