Skip to content

Commit d064365

Browse files
authored
Add basic style guide (#53)
1 parent b9339f5 commit d064365

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

docs/contributing/index.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This documentation is developed using the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) framework, and the source code for the docs is publicly available on [GitHub](https://github.com/eth-cscs/cscs-docs).
44
This means that everybody, CSCS staff and the CSCS user community can contribute to the documentation.
55

6-
## Getting Started
6+
## Getting started
77

88
We use the GitHub fork and pull request model for development:
99

@@ -40,7 +40,7 @@ To build the docs in a `site` sub-directory:
4040
```bash
4141
./serve build
4242
```
43-
## Review Process
43+
## Review process
4444

4545
Documentation is owned by everybody - so don't be afraid to jump in and make changes or fixes where you see that there is something missing or outdated.
4646

@@ -57,7 +57,7 @@ If you don't get a timely reply, ask the documentation owners for a review or fo
5757

5858
### Links
5959

60-
#### External Links
60+
#### External links
6161

6262
Links to external sites use the `[]()` syntax:
6363

@@ -71,7 +71,7 @@ Links to external sites use the `[]()` syntax:
7171

7272
[The Spack repository](https://github.com/spack/spack)
7373

74-
#### Internal Links
74+
#### Internal links
7575

7676
!!! note
7777
The CI/CD pipeline will fail if it detects broken links in your draft documentation.
@@ -124,7 +124,7 @@ Images are stored in the `docs/images` directory.
124124
!!! tip
125125
Do you need a screenshot, or can a text description also work?
126126

127-
### Text Formatting
127+
### Text formatting
128128

129129
Turn off automatic line breaks in your text editor, and stick to one sentence per line in paragraphs of text.
130130

@@ -169,7 +169,7 @@ This method defines a canonical represention of text, i.e. there is one and only
169169
* changing one line of text will not modify the surrounding lines (see example above)
170170
* git diffs and git history are easier to read.
171171

172-
### Frequently Asked Questions
172+
### Frequently asked questions
173173

174174
The documentation does not have a FAQ section, because questions are best answered by the documentation, not in a separate section.
175175
Integrating information into the main documentation requires some care to identify where the information needs to go, and edit the documentation around it.
@@ -179,7 +179,7 @@ FAQ content, such as lists of most frequently encountered error messages, is sti
179179
If you want to add such content, create a section at the bottom of a topic page, for example this section on the [SSH documentation page][ref-ssh-faq].
180180

181181

182-
### Small Contributions
182+
### Small contributions
183183

184184
Small changes that only modify the contents of a single file, for example to fix some typos or add some clarifying detail to an example, it is possible to quickly create a pull request directly in the browser.
185185

@@ -192,3 +192,39 @@ Once your changes are ready, click on the "Commit changes..." button in the top
192192

193193
* if the change is small and you are CSCS staff, you can merge the PR immediately
194194
* all other changes can be
195+
196+
## Style guide
197+
198+
This section contains general guidelines for how to format and present documentation in this repository.
199+
They should be followed for most cases, but as a guideline it can be broken, _with good reason_.
200+
201+
### Headings are written in sentence case
202+
203+
Use [title case](https://en.wikipedia.org/wiki/Letter_case#Sentence_case) for headings, meaning all words are capitalized except for minor words.
204+
205+
### Avoid nesting headings too deep
206+
207+
Nesting headings up to three levels is generally ok.
208+
209+
### Lists
210+
211+
Write lists as proper sentences.
212+
Separate the items simply with commas if each item is simple, or make each item a full sentence if the items are longer and contain multiple sentences.
213+
214+
1. The first item can look like this,
215+
2. the second like this, and
216+
3. the third item like this.
217+
218+
### Using admonitions
219+
220+
Aim to include examples, notes, warnings using [admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) whenever appropriate.
221+
They stand out better from the main text, and can be collapsed by default if needed.
222+
223+
!!! example "Example one"
224+
This is an example.
225+
The title of the example uses [sentence case](https://en.wikipedia.org/wiki/Letter_case#Sentence_case).
226+
227+
??? note "Collapsed note"
228+
This note is collapsed, because it uses `???`.
229+
230+
If an admonition is collapsed by default, it should have a title.

0 commit comments

Comments
 (0)