Skip to content

Commit 0ab24d6

Browse files
committed
<various>: Reorganise content about contributing.
* Move contents of `style-guide` and `submitting` to `CONTRIBUTING`. * Move contents of `usage-statistics` to `contributing/index`. * Remove `style-guide`, `submitting`, `usage-statistics`. * Modify text of `CONTRIBUTING` appropriately. * Modify and improve text of `contributing/index`.
1 parent 0d8ac71 commit 0ab24d6

File tree

7 files changed

+376
-329
lines changed

7 files changed

+376
-329
lines changed

CONTRIBUTING.md

Lines changed: 341 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,343 @@
1-
To contribute to the Void documentation, please read the following sections of the Void Handbook. Pull requests that do not meet the criteria described in these sections will not be merged. Please try to address as many of the criteria as possible before submitting a PR - that will improve the chances of your contribution being accepted quickly.
1+
# Contributing
22

3-
- [About this Handbook](https://docs.voidlinux.org/about/about-this-handbook.html)
4-
- [Style Guide](https://docs.voidlinux.org/contributing/void-docs/style-guide.html)
5-
- [Submitting Changes](https://docs.voidlinux.org/contributing/void-docs/submitting.html)
3+
To contribute to the Void documentation, please read the following. Pull
4+
requests that do not meet the criteria described below will not be merged.
5+
Before submitting a PR:
66

7-
In particular, please be sure to run this repository's `check.sh` script, and to address any issues it raises, before submitting your PR.
7+
- try to address as many of the criteria as possible; and
8+
- run the `check.sh` script provided in the repository root, addressing any
9+
issues it reports.
10+
11+
This will improve the chances of your contribution being accepted quickly.
12+
13+
## Contents
14+
15+
- [Suitable Content](#suitable-content)
16+
- [Style Guide](#style-guide)
17+
- [Submitting Changes](#submitting-changes)
18+
19+
## Suitable content
20+
21+
The Handbook is not intended to be a general guide to using a Linux system, as
22+
[noted in the "About"
23+
section](https://docs.voidlinux.org/about/about-this-handbook.html):
24+
25+
> This handbook is not an extensive guide on how to use and configure common
26+
> Linux software. The purpose of this document is to explain how to install,
27+
> configure, and maintain Void Linux systems, and to highlight the differences
28+
> between common Linux distributions and Void ...
29+
>
30+
> Those looking for tips and tricks on how to configure a Linux system in
31+
> general should consult upstream software documentation. Additionally, the Arch
32+
> Wiki provides a fairly comprehensive outline of common Linux software
33+
> configuration, and a variety of internet search engines are available for
34+
> further assistance.
35+
36+
Thus, we are unlikely to accept contributions which add information that is not
37+
particularly Void-specific.
38+
39+
## Style Guide
40+
41+
This style guide outlines the standards for contributing to the Handbook. The
42+
manual on <https://docs.voidlinux.org> is generated from an
43+
[mdBook](https://rust-lang.github.io/mdBook/) stored in the
44+
[void-docs](https://github.com/void-linux/void-docs/) repository.
45+
46+
### General
47+
48+
Although there will always be cases where command listings are appropriate, the
49+
contents of the Handbook should be written in American English.
50+
51+
Outside of the 'installation' sections, step-by-step instructions containing
52+
'magic' commands for copying-and-pasting are strongly discouraged. Users are
53+
expected to read the canonical documentation (e.g. man pages) for individual
54+
programs to understand how to use them, rather than relying on
55+
copying-and-pasting.
56+
57+
Command code-blocks should not be used to describe routine tasks documented
58+
elsewhere in this Handbook. For example, when writing documentation for the
59+
`foo` package, do not provide a command code-block stating that one should
60+
install it via `xbps-install foo`. Similarly, do not provide code blocks
61+
describing how to enable the `foo` service.
62+
63+
### Formatting
64+
65+
For markdown formatting, the
66+
[void-docs](https://github.com/void-linux/void-docs/) project uses the
67+
[Versioned Markdown](https://github.com/bobertlo/vmd) format, and enforces use
68+
of the auto-formatter `vmdfmt`, which works very similarly to `gofmt`. Most
69+
valid markdown is accepted by the formatter. The output format is described in
70+
the project's [README](https://github.com/bobertlo/vmd/blob/master/README.md).
71+
72+
After installing the `vmdfmt` package, you can format a file by running:
73+
74+
```
75+
vmdfmt -w <filepath>
76+
```
77+
78+
To format the entire mdbook from the repository root, outputting a list of files
79+
modified, run:
80+
81+
```
82+
vmdfmt -w -l <filepath>
83+
```
84+
85+
`vmdfmt` is used by the void-docs repository's `check.sh` script, which must be
86+
[run locally before submitting a pull request](#making-changes).
87+
88+
### Commands
89+
90+
Command code-blocks should start with a `#` or `$` character, indicating whether
91+
the command should be run as `root` or a regular user, respectively.
92+
93+
For example:
94+
95+
```
96+
# vi /etc/fstab
97+
```
98+
99+
and not:
100+
101+
```
102+
$ sudo vi /etc/fstab
103+
```
104+
105+
and also not:
106+
107+
```
108+
vi /etc/fstab
109+
```
110+
111+
Command code-blocks should be introduced with a colon (':'), i.e.:
112+
113+
> For example:
114+
>
115+
> `$ ls -l`
116+
117+
#### Placeholders
118+
119+
Placeholders indicate where the user should substitute the appropriate
120+
information. They should use angle brackets (`<` and `>`) and contain only
121+
lower-case text, with words separated by underscores. For example:
122+
123+
```
124+
# ln -s /etc/sv/<service_name> /var/service/
125+
```
126+
127+
and not:
128+
129+
```
130+
# ln -s /etc/sv/[SERVICENAME] /var/service/
131+
```
132+
133+
### Links
134+
135+
Link text should not include sentence-level punctuation. For example:
136+
137+
```
138+
[Visit this site](https://example.org).
139+
```
140+
141+
and not:
142+
143+
```
144+
[Visit this site.](https://example.org)
145+
```
146+
147+
#### Internal links
148+
149+
Links to other sections of the Handbook must be relative. For example:
150+
151+
```
152+
[example](./example.md#heading-text)
153+
```
154+
155+
and not:
156+
157+
```
158+
[example](example.md#heading-text)
159+
```
160+
161+
When referring literally to a Handbook section, the section title should be
162+
placed in double-quotes. Otherwise, double-quotes are not required. For example:
163+
164+
```
165+
For more information, please read the "[Power Management](./power-management.md)" section.
166+
```
167+
168+
and
169+
170+
```
171+
Void provides facilities to assist with [power management](./power-management.md).
172+
```
173+
174+
#### Man Page Links
175+
176+
The first reference to a command or man page must be a link to the relevant man
177+
page on `https://man.voidlinux.org/`.
178+
179+
The link text must contain the title section number in parenthesis, and contain
180+
no formatting. For example: [man(1)](https://man.voidlinux.org/man.1), not
181+
[`man(1)`](https://man.voidlinux.org/man.1).
182+
183+
#### Auto Links
184+
185+
Auto links (links with the same title as URL) should use the following notation:
186+
187+
```
188+
<https://www.example.com/>
189+
```
190+
191+
They should not be formatted like this:
192+
193+
```
194+
[https://www.example.com/](https://www.example.com/)
195+
```
196+
197+
#### Checking links
198+
199+
If you're including new links (either internal or external) in the docs or
200+
changing the current file structure, you should make use of the
201+
`mdbook-linkcheck` package:
202+
203+
```
204+
$ mdbook-linkcheck -s
205+
```
206+
207+
This will verify all the references, and warn you if there are any issues. If
208+
any link you're using is correct but generating errors for some reason, you can
209+
add its domain to the exclude list in `book.toml`, under the
210+
`[mdbook.linkcheck]` key.
211+
212+
`mdbook-linkcheck` is used by the void-docs repository's `check.sh` script,
213+
which must be [run locally before submitting a pull request](#making-changes).
214+
215+
### Case
216+
217+
Filenames and directories should use [kebab
218+
case](https://en.wikipedia.org/wiki/Kebab_case) when splitting words. For
219+
example the filename should be `post-install.md` not `postinstall.md`.
220+
221+
Words that are part of trademarks or well known package names are exempt from
222+
this rule. Examples include `PulseAudio` and `NetworkManager` which are well
223+
known by their squashed names.
224+
225+
### Voice
226+
227+
Prefer the active imperative voice when writing documentation. Consider the
228+
following examples:
229+
230+
> Now we need to install the CUPS drivers and configure them.
231+
232+
This version is conversational and friendlier, but contains unnecessary language
233+
that may not be as clear to an ESL reader.
234+
235+
> Install and configure the CUPS drivers, then configure them as shown.
236+
237+
This version contains a clear command to act, and a follow up that shows what
238+
will be done next. It is clear both to native English speakers, ESL readers, and
239+
to translators.
240+
241+
### Warnings
242+
243+
Warnings should begin with `**Warning**:`, and should not be block-quoted with
244+
`>`. For example, the Markdown should look like:
245+
246+
```
247+
**Warning**: Selecting the wrong option will set your printer on fire.
248+
```
249+
250+
and not:
251+
252+
```
253+
> WARNING: Selecting the wrong option will set your printer on fire.
254+
```
255+
256+
### Notes
257+
258+
Notes should only be used sparingly, and for non-critical information. They
259+
should begin with a phrase such as "Note that ..." or "It should be noted that
260+
... ", and not be block-quoted with `>`. For example, the Markdown should look
261+
like:
262+
263+
```
264+
Note that you can also use program X for this purpose.
265+
```
266+
267+
and not:
268+
269+
```
270+
> You can also use program X for this purpose.
271+
```
272+
273+
### Block quotes
274+
275+
Block quotes (i.e. `>`) should only be used to quote text from an external
276+
source.
277+
278+
## Submitting Changes
279+
280+
Proposed changes should be submitted as pull requests to the
281+
[void-docs](https://github.com/void-linux/void-docs) repository on
282+
[GitHub](https://github.com/). Please note that, unlike a wiki, submissions will
283+
be reviewed before they are merged. If any changes are required they will need
284+
to be made before the pull request is accepted. This process is in place to
285+
ensure the quality and standards of the Handbook are sustained.
286+
287+
### Requirements
288+
289+
To clone the repository and push changes,
290+
[git(1)](https://man.voidlinux.org/git.1) is required. It can be installed via
291+
the `git` package.
292+
293+
Building the Handbook locally requires
294+
[mdBook](https://rust-lang.github.io/mdBook/), which can be installed via the
295+
`mdBook` package.
296+
297+
### Forking
298+
299+
To fork the repository a [GitHub account](https://github.com/join) is needed.
300+
Once you have an account, follow GitHub's
301+
[guide](https://help.github.com/en/articles/fork-a-repo) on setting up a fork.
302+
303+
Clone the repository onto your computer, enter it, and create a new branch:
304+
305+
```
306+
$ git clone https://github.com/<your_username>/void-docs.git
307+
$ cd void-docs
308+
$ git checkout -b <branch_name>
309+
```
310+
311+
You can then edit the repository files as appropriate.
312+
313+
### Making changes
314+
315+
To serve the docs locally and view your changes, run `mdbook serve` from the
316+
root of the repository.
317+
318+
Once you're satisfied with your changes, run the `check.sh` script provided in
319+
the repository root. This will run the `vmdfmt` command, which will wrap the
320+
text appropriately, and the `mdbook-linkcheck` command, which will check for
321+
broken links. Address any issues raised by `check.sh`.
322+
323+
Once `check.sh` runs without errors, push your changes to your forked
324+
repository:
325+
326+
```
327+
$ git add <edited_file(s)>
328+
$ git commit -m "<commit_message>"
329+
$ git push --set-upstream origin <branch_name>
330+
```
331+
332+
The commit message should be in the form `<filename>: <description_of_changes>`.
333+
334+
Pull requests should only contain a single commit. If a change is made after the
335+
initial commit, `git add` the changed files and then run `git commit --amend`.
336+
The updated commit will need to be force-pushed: `git push --force`.
337+
338+
If multiple commits are made they will need to be squashed into a single commit
339+
with `git rebase -i HEAD~X`, where `X` is the number of commits that need to be
340+
squashed. An editor will appear to choose which commits to squash. A second
341+
editor will appear to choose the commit message. See
342+
[git-rebase(1)](https://man.voidlinux.org/git-rebase.1) for more information.
343+
The updated commit will need to be force-pushed: `git push --force`.

src/SUMMARY.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,4 @@
7474
- [Common Errors](./xbps/troubleshooting/common-errors.md)
7575
- [Static XBPS](./xbps/troubleshooting/static.md)
7676
- [Contributing](./contributing/index.md)
77-
- [Usage Statistics](./contributing/usage-statistics.md)
7877
- [Contributing To void-docs](./contributing/void-docs/index.md)
79-
- [Style Guide](./contributing/void-docs/style-guide.md)
80-
- [Submitting Changes](./contributing/void-docs/submitting.md)

0 commit comments

Comments
 (0)