Skip to content

Commit a99f96d

Browse files
taliagamsimbergbcumming
authored
Improving contributing guide (#194)
Updating contributing guide: - Change order in "Getting started" section to promote self-review before push - Clarify Review Process section, confusing use of owner term? - Images: screenshots vs diagrams, promoting diagrams as code :) Fun facts worth noting: - The contributing guide for updating the contributing guide is the same contributing guide - Some contributions to the contributing guide could eventually be both a violation and an improvement of the guide --------- Co-authored-by: Mikael Simberg <[email protected]> Co-authored-by: Ben Cumming <[email protected]>
1 parent 42866c7 commit a99f96d

File tree

2 files changed

+78
-29
lines changed

2 files changed

+78
-29
lines changed

.github/actions/spelling/allow.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ santis
256256
sbatch
257257
scalapack
258258
screenshot
259+
screenshots
259260
slepc
260261
slurm
261262
smartphone

docs/contributing/index.md

Lines changed: 77 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This means that everybody, CSCS staff and the CSCS user community can contribute
77

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

10-
* First create a fork of the [main GitHub repository](https://github.com/eth-cscs/cscs-docs).
10+
* First create a [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) of the [main GitHub repository](https://github.com/eth-cscs/cscs-docs).
1111
* Make all proposed changes in branches on your fork - don't make branches on the main repository (we reserve the right to block creating branches on the main repository).
1212

1313
Clone your fork repository on your PC/laptop:
@@ -18,46 +18,52 @@ cd cscs-docs
1818
# create a branch for your changes (here we are fixing the ssh docs)
1919
git switch -c 'fix/ssh-alias'
2020
# ... make your edits ...
21-
# add and commit your changes
22-
git add <files>
23-
git commit -m 'update the ssh docs with aliases for all user lab vclusters'
24-
git push origin 'fix/ssh-alias'
2521
```
26-
Then navigate to GitHub, and create a pull request.
2722

28-
The `serve` script in the root path of the repository can be used to view the docs locally:
23+
Review your edits checking the [Guidelines][ref-contributing-guidelines] section below.
24+
25+
!!! note
26+
Note that a simple editor markdown preview may not render all the features of the documentation.
27+
28+
To properly review the docs locally, the `serve` script in the root path of the repository can be used as shown below:
2929
```bash
3030
./serve
3131
...
3232
INFO - [08:33:34] Serving on http://127.0.0.1:8000/
3333
```
34-
This generates the documentation locally, which can be viewed using a local link, which is `http://127.0.0.1:8000/` by default.
35-
The documentation will be rebuilt and the webpage reloaded when changed files are saved.
3634

3735
!!! note
3836
To run the serve script, you need to first install [uv](https://docs.astral.sh/uv/getting-started/installation/).
3937

40-
To build the docs in a `site` sub-directory:
38+
You can now open your browser at the address shown above (`http://127.0.0.1:8000/`). The documentation will be automatically rebuilt and the webpage reloaded on each file change you save.
39+
40+
After your first review, commit and push your changes
4141
```bash
42-
./serve build
42+
git add <files>
43+
git commit -m 'update the ssh docs with aliases for all user lab vclusters'
44+
git push origin 'fix/ssh-alias'
4345
```
4446

47+
Then navigate to GitHub, and create a pull request.
48+
4549
!!! tip
4650
If you've already created a fork repository, make sure to [keep it synced](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to the main CSCS repository before making further change.
4751

4852
## Review process
4953

50-
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.
54+
Documentation is maintained by everybody - so don't be afraid to jump in and make changes or fixes where you see the need or the potential.
5155

52-
If you plan to make large changes or contributions, please discuss them with the documentation owners beforehand, to make sure that the documentation will fit into the larger documentation structure.
56+
If you plan to make significant changes, please discuss them with an [issue](https://github.com/eth-cscs/cscs-docs/issues) beforehand, to ensure the changes will fit into the larger documentation structure.
5357

54-
If the documentation that you write or update might affect multiple stakeholders, ping them for a review.
55-
If you don't get a timely reply, ask the documentation owners for a review or for permission to merge.
58+
If you think your documentation update could affect specific stakeholders, ping them for a review.
59+
The same applies if you are not getting get a timely reply for your pull request.
60+
You can get some hints of whom to contact by looking at [CODEOWNERS](https://github.com/eth-cscs/cscs-docs/blob/main/.github/CODEOWNERS).
5661

5762
!!! note
5863
To minimise the overhead of the contributing to the documentation and speed up "time-to-published-docs" we do not have a formal review process.
5964
We will start simple, and add more formality as needed.
6065

66+
[](){#ref-contributing-guidelines}
6167
## Guidelines
6268

6369
### Links
@@ -89,11 +95,11 @@ Instead, we advocate adding unique references to sections.
8995

9096
=== "adding a reference"
9197

92-
Add a reference above the item, in this case we want to link to the section with the title `## The Fast Server`:
98+
Add a reference above the item, in this case we want to link to the section with the title `## The fast server`:
9399

94100
```
95-
[](){#ref-servers-fast}
96-
## Fast Server
101+
[](){#ref-fast-server}
102+
## Fast server
97103
```
98104

99105
Use the `[](){#}` syntax to define the reference/anchor.
@@ -106,7 +112,7 @@ Instead, we advocate adding unique references to sections.
106112
In any other file in the project, use the `[][]` syntax to refer to the link (note that this link type uses square braces, instead of the usual parenthesis):
107113

108114
```
109-
[the fast server][ref-servers-fast]
115+
[the fast server][ref-fast-server]
110116
```
111117

112118
The benefits of this approach are that the link won't break if
@@ -116,18 +122,60 @@ The benefits of this approach are that the link won't break if
116122

117123
### Images
118124

125+
> A picture is worth a thousand words
126+
127+
We encourage the usage of images to improve clarity and understanding. You can use **screenshots** or **diagrams**.
128+
119129
Images are stored in the `docs/images` directory.
120130

121-
* there are sub-directories in the `docs/images` path - create a new sub-directory for your images if appropriate
122-
* choose image and path names that make sense - `screenshot.png` is not a great file name. Neither is `PX-202502025-imgx.png`.
131+
* create a new sub-directory for your images if appropriate
132+
* choose a path and file name that hint what the image is about - neither `screenshot.png` nor `PX-202502025-imgx.png` are great names.
123133

124-
!!! tip
125-
When providing a screenshot, do you need to show the whole screen, or just part of one window?
134+
!!! warning
135+
Keep the size of your images to a minimum because we want to keep an overall lightweight repository.
126136

127-
Cropping the image will decrease file size, and might also draw the readers attention to the most relevant information.
128137

129-
!!! tip
130-
Do you need a screenshot, or can a text description also work?
138+
#### Screenshots
139+
140+
Screenshots can help readers follow steps on guides. Think if you need to show the whole screen or just part of one window. Cropping the image will decrease file size, and might also draw the readers attention to the most relevant information.
141+
142+
Often, screenshots can quickly become obsolete, so you may want to complement (or maybe even replace) some with text descriptions.
143+
144+
#### Diagrams
145+
146+
Diagrams can help readers understand more abstract concepts like processes or architectures. We suggest you use [mermaid](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-mermaid-diagrams). Such format makes diagrams easy to maintain and removes the need to commit image files in the repository.
147+
148+
??? "Example"
149+
150+
=== "Source"
151+
152+
````text
153+
```mermaid
154+
graph TD;
155+
Image(Will image add value?);
156+
Image--NO-->T(keep text only);
157+
Image--YES-->SD(What image is needed?)
158+
SD--Screenshot-->S(keep it lean)
159+
SD--Diagram-->D(keep it maintainable)
160+
D--Default-->M(Mermaid)
161+
D--Custom-->DR(Draw.io)
162+
```
163+
````
164+
165+
=== "Rendered"
166+
167+
```mermaid
168+
graph TD;
169+
Image(Will image add value?);
170+
Image--NO-->T(keep text only);
171+
Image--YES-->SD(What image is needed?)
172+
SD--Screenshot-->S(keep it lean)
173+
SD--Diagram-->D(keep it maintainable)
174+
D--Default-->M(Mermaid)
175+
D--Custom-->DR(Draw.io)
176+
```
177+
178+
If you need more hand-crafted diagrams, we suggest you use [draw.io](https://www.drawio.com/). Make sure you export the png with the [source inside](https://www.drawio.com/doc/faq/export-to-png), typically a `file.drawio.png`, so it can be extended in the future as needed.
131179

132180
### Text formatting
133181

@@ -193,7 +241,7 @@ At the top of each page there is an "edit" icon :material-pencil:, which will op
193241
Once your changes are ready, click on the "Commit changes..." button in the top right hand corner of the editor, and add at least a description commit message.
194242

195243
!!! tip
196-
See [the GitLab official guide on editing files](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files) for a step-by-step walkthrough.
244+
See [the GitHub official guide on editing files](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files) for a step-by-step walkthrough.
197245

198246
!!! note
199247
Use the default option **Create a new branch for this commit and start a pull request**.
@@ -230,10 +278,10 @@ They stand out better from the main text, and can be collapsed by default if nee
230278
!!! example "Example one"
231279
This is an example.
232280
The title of the example uses [sentence case](https://en.wikipedia.org/wiki/Letter_case#Sentence_case).
233-
281+
234282
??? note "Collapsed note"
235283
This note is collapsed, because it uses `???`.
236-
284+
237285
If an admonition is collapsed by default, it should have a title.
238286

239287
We provide some custom admonitions.

0 commit comments

Comments
 (0)