Skip to content

Commit d50be7b

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 ecd8e2c commit d50be7b

File tree

6 files changed

+360
-327
lines changed

6 files changed

+360
-327
lines changed

CONTRIBUTING.md

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

src/contributing/index.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
11
# Contributing
22

3-
There's more to running a distribution than just writing code. This section
4-
explains how to be an active part of Void.
3+
There's more to running a distribution than just writing code.
54

6-
Please also visit the Void Web site for further information about [how to
7-
participate](https://voidlinux.org/contribute/), including our communication
8-
channels and how to contribute to the Void package repository.
5+
To contribute to the Void packages repository, start by reading the
6+
[CONTRIBUTING](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md)
7+
document in the void-packages GitHub repository.
98

10-
## Section Contents
9+
To contribute to the Void documentation, start be reading the
10+
[CONTRIBUTING](https://github.com/void-linux/void-docs/blob/master/CONTRIBUTING.md)
11+
document in the void-docs GitHub repository.
1112

12-
- [Usage Statistics](./usage-statistics.md)
13-
- [Contributing To The void-docs Project](./void-docs/index.md)
13+
If you have any questions, ask them via IRC in #voidlinux on irc.freenode.net,
14+
or in [the voidlinux subreddit](https://reddit.com/r/voidlinux).
15+
16+
## Usage Statistics
17+
18+
If you would like to contribute usage reports, the
19+
[PopCorn](https://github.com/the-maldridge/popcorn) program reports installation
20+
statistics back to the Void project. These statistics are purely opt-in, the
21+
reporting programs are *not* installed by default on any void systems.
22+
23+
*PopCorn* only reports which packages are installed, their version, and the host
24+
CPU architecture (the output of `xuname`). This does not report which services
25+
are enabled, or any other personal information. Individual systems are tracked
26+
persistently by a random (client-generated) UUID, to ensure that each system is
27+
only counted once in each 24-hour sampling period.
28+
29+
The data collected by *PopCorn* is available to view at
30+
<http://popcorn.voidlinux.org>
31+
32+
### Setting up PopCorn
33+
34+
First, install the `PopCorn` package. Then, enable the `popcorn` service, which
35+
will attempt to report statistics once per day.

0 commit comments

Comments
 (0)