You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[article from GeeksforGeeks]: https://www.geeksforgeeks.org/how-to-create-a-new-branch-in-git/
5
5
[creating a PR]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
6
6
[documentation on forking repositories]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo
7
7
[documentation on reviewing PRs]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request
8
-
[Core Principles]: #core-principles
8
+
[Core Principles]: #ch-core-principles
9
9
[testing documentation]: ./TESTING.html
10
-
[reviewed]: #reviewing-a-pr
10
+
[reviewed]: #ch-reviewing-a-pr
11
11
[REVIEWING.md]: ./REVIEWING.html
12
12
13
13
Hjem Rum (or HJR) is always in need of contributions as a module collection. As
@@ -21,7 +21,7 @@ If you are familiar with contributing to open source software, you can safely
21
21
skip ahead to [Core Principles]. Otherwise, read the following section to learn
22
22
how to fork a repo and open a PR.
23
23
24
-
## Getting Started
24
+
## Getting Started {#ch-getting-started}
25
25
26
26
To begin contributing to HJR, you will first need to create a fork off of the
27
27
main branch in order to make changes. For info on how to do this, we recommend
@@ -33,7 +33,7 @@ from your fork. To do so, you can read this [article from GeeksforGeeks] that
33
33
will also explain branches for you. Don't worry too much about the technical
34
34
details, the most important thing is to make and switch to a branch from HEAD.
35
35
36
-
### Commit format
36
+
### Commit Format {#sec-commit-format}
37
37
38
38
> [!TIP]
39
39
> Our dev shell allows for interactive commits, through the means of
@@ -77,7 +77,7 @@ After you have setup a PR, it will be [reviewed] by maintainers and changes may
77
77
be requested. Make the changes requested and eventually it will likely be
78
78
accepted and merged into main.
79
79
80
-
## Core Principles
80
+
## Core Principles {#ch-core-principles}
81
81
82
82
In creating HJR, we had a few principles in mind for development:
83
83
@@ -88,13 +88,13 @@ In creating HJR, we had a few principles in mind for development:
88
88
Please keep these in mind as you read through our general guidelines for
89
89
contributing.
90
90
91
-
## Guidelines
91
+
## Guidelines {#ch-guidelines}
92
92
93
93
These guidelines, are, of course, merely guidelines. There are and will continue
94
94
to be exceptions. However, do your best to stick to them, and keep in mind that
95
95
reviewers will hold you to them as much as possible.
96
96
97
-
### Aliases
97
+
### Aliases {#sec-aliases}
98
98
99
99
At the top of any module, there should always be a `let ... in` set. Within
100
100
this, functions should have their location aliased, cfg should be aliased, and
@@ -132,7 +132,7 @@ and `type`, so the alias name is just `toml`.
132
132
Always be sure to include `cfg` that links to the point where options are
133
133
configured by the user.
134
134
135
-
### Writing Options
135
+
### Writing Options {#sec-writing-options}
136
136
137
137
Writing new options is the core of any new module. It is also the easiest place
138
138
to blunder. As stated above, a core principle of HJR is to minimize the number
@@ -254,7 +254,7 @@ default. This can also be used in `mkOption`, but it is more common to use it in
254
254
If you do not set this, the docs builder will break due to not knowing how to
255
255
resolve the reference to `config`.
256
256
257
-
### Conditionals in Modules
257
+
### Conditionals in Modules {#sec-conditionals-in-modules}
258
258
259
259
Always use a `mkIf` before the `config` section. Example:
260
260
@@ -366,7 +366,7 @@ First, the file is only written if any of the options to write to the file are
366
366
set. `optionalString` is then used to compile each option's results in an
367
367
optimized and clean way.
368
368
369
-
### Extending RumLib
369
+
### Extending RumLib {#sec-extending-rumlib}
370
370
371
371
Rather than having functions scattered throughout the module collection, we
372
372
would rather keep our directories organized and purposeful. Therefore, all
@@ -394,7 +394,7 @@ Additionally, please follow how lib is structured in Nixpkgs. For example, the
394
394
custom function `attrsNamesHasPrefix` is under `attrsets` to signify that it
395
395
operates on an attribute set, just like in Nixpkgs.
396
396
397
-
### Docs
397
+
### Docs {#sec-docs}
398
398
399
399
If you would like to contribute to our documentation, we ask a few things of
400
400
you:
@@ -430,12 +430,30 @@ Make sure to use {file}`lib.options.mkEnableOption`, like is done in
430
430
If you do not do it like this, the link check on the docs will fail, since our
431
431
docs generator will attempt to make hyperlinks out of those function names.
432
432
433
-
### Tests
433
+
Headers should always have an anchor with them to ensure the link checker can
434
+
follow header links at time of build. Follow these examples, and you should find
435
+
it simple:
436
+
437
+
```md
438
+
# My new document page {#my-new-document-page}
439
+
440
+
## My 1st chapter heading! {#ch-my-1st-chapter-heading}
441
+
442
+
### WHAT_DI-887-NI-DO>????? WRONG ? my cool section! {#sec-what-di-887-ni-do-wrong-my-cool-section}
443
+
```
444
+
445
+
Words should be separated by `-`, special characters should be removed, numbers
446
+
are fine to keep, extra spaces should be removed, everything should be lower
447
+
caps, first headings have no prefix, second headings have `ch` prefix, third
448
+
headings have `sec` prefix, etc. If you're unsure, just give it your best shot
449
+
and a reviewer will make sure it's as it should be.
450
+
451
+
### Tests {#sec-tests}
434
452
435
453
Please refer to the [testing documentation] for more information on how tests
436
454
work.
437
455
438
-
## Reviewing a PR
456
+
## Reviewing a PR {#ch-reviewing-a-pr}
439
457
440
458
Even if you do not have write-access, you can always leave a review on someone
441
459
else's PR. Again, GitHub has great [documentation on reviewing PRs]. This is
0 commit comments