Skip to content

Commit b194f33

Browse files
authored
docs: revise CONTRIBUTING.md (#480)
follow-up to #479 This basically reorganizes information that was already there, while replacing some outdated instructions with `uv` commands.
1 parent 44dd0c5 commit b194f33

File tree

1 file changed

+50
-34
lines changed

1 file changed

+50
-34
lines changed

CONTRIBUTING.md

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,89 @@
44
2. Open an issue if your query has not been previously addressed.
55
3. If a solution is found, and requires changes to this repository, then submit a Pull Request.
66

7-
## Code style
7+
## Unwanted changes
88

9-
We use linters to keep our code style conventional. Thus, this repository is setup to use many of the popular linting and code formatting tools available.
9+
Anything contained within the _src_ folder is meant to be merged from the upstream mkdocs-material repo. As such, it is discouraged from making any changes that might cause a merge conflict when new changes are pulled from the upstream repository.
1010

11-
Please be sure to review/format your code changes in accordance with the style guides incorporated in this repository (which are typically named _.**rc_).
11+
There is no intention to support any mkdocs extensions in this theme because this theme is designed for the Sphinx documentation generator. You will often find that most of the extensions available for mkdocs are natively implemented in Sphinx or available in the form of a Sphinx extension.
1212

13-
### Using `nox` & `npm`
13+
## Required development tools
1414

15-
Most of our CI uses a program utility called `nox`.
16-
For JS and SCSS checking, we use `npm` tasks.
15+
These are the tools that this project uses:
1716

18-
#### Run type checkers and formatters for Python
17+
- [`uv` package manager](https://docs.astral.sh/uv/getting-started/installation/)
18+
- [node.js](https://nodejs.org/en/download) (using [`fnm`](https://github.com/Schniz/fnm) is highly recommended)
1919

20-
Be sure `nox` is installed via `pip install nox`.
20+
The rest of this document will assume that these tools are installed.
2121

22-
From the repository root directory:
22+
### Setup a venv
2323

24-
```shell
25-
nox
24+
Use the following command to setup a Python virtual environment ("venv" for short) specifically for this project:
25+
26+
```text
27+
uv sync
2628
```
2729

28-
More info is available via `nox -h` or [their documentation](https://nox.thea.codes/en/stable/usage.html).
30+
### Setup node.js
2931

30-
#### Run type checkers and formatters for JS & SCSS
32+
Install the node.js dependencies (used for development):
3133

32-
```shell
33-
npm run check
34+
```text
35+
npm install
3436
```
3537

36-
## Unwanted changes
38+
Next, compile and copy the CSS/JS bundles and icons that this theme uses (at docs' build time and for theme distribution):
3739

38-
Anything contained within the _src_ folder is meant to be merged from the upstream mkdocs-material repo. As such, it is discouraged from making any changes that might cause a merge conflict when new changes are pulled from the upstream repository.
40+
```text
41+
npm run build
42+
```
3943

40-
There is no intention to support any mkdocs extensions in this theme because this theme is designed for the Sphinx documentation generator. You will often find that most of the extensions available for mkdocs are natively implemented in Sphinx or available in the form of a Sphinx extension.
44+
## Code style
4145

42-
## Building this project's docs
46+
We use linters to keep our code style conventional. Thus, this repository is setup to use many of the popular linting and code formatting tools available.
4347

44-
Install the following development tools:
48+
Please be sure to review/format your code changes in accordance with the style guides incorporated in this repository (which are found in various configuration files).
4549

46-
- [`uv` package manager](https://docs.astral.sh/uv/getting-started/installation/)
47-
- [Graphviz](https://graphviz.org/download/) (for generating graphs at docs' build-time)
48-
- [node.js](https://nodejs.org/en/download) (using [fnm](https://github.com/Schniz/fnm) is highly recommended)
50+
### Run type checkers and formatters for Python
4951

50-
Setup the Python venv:
52+
The following command uses the venv prepared as directed in [setup a venv](#setup-a-venv):
5153

52-
```text
53-
uv sync
54+
```shell
55+
uv run nox
5456
```
5557

56-
Assembling/copying over CSS/JS bundles and icons:
58+
More info is available via `uv run nox -h` or [their documentation](https://nox.thea.codes/en/stable/usage.html).
5759

58-
```text
59-
npm install
60-
npm run build
60+
### Run type checkers and formatters for JS & SCSS
61+
62+
```shell
63+
npm run check
6164
```
6265

63-
Build documentation:
66+
## Building this project's docs
67+
68+
Install the following tools (in addition to the [required development tools](#required-development-tools)):
69+
70+
- [Graphviz](https://graphviz.org/download/) (for generating graphs at docs' build-time)
71+
72+
### Run sphinx
73+
74+
Assuming the [node.js dependencies are setup](#setup-nodejs),
75+
run sphinx using the following nox command:
6476

6577
```text
6678
uv run nox -s "docs(html)"
6779
```
6880

69-
This sets up a Python venv (managed by `nox`), ensures necessary docs' (Python) dependencies are installed, and runs `sphinx-build`.
81+
This command basically does the following:
82+
83+
1. Sets up a Python venv (just for building docs) which is managed by `nox`.
84+
2. Ensures necessary docs' (Python) dependencies are installed.
85+
3. Runs `sphinx-build` using the HTML builder.
7086

71-
If the last command completed successfully, the HTML docs can be browsed locally from the generated `docs/_build/html/index.html` file.
87+
Once the `nox` command has completed, the HTML docs can be browsed locally from the generated `docs/_build/html/index.html` file.
7288

73-
### Merging in changes from upstream
89+
## Merging in changes from upstream
7490

7591
There is a script titled "merge_from_mkdocs_material.py" that is designed to do most of the heavy lifting when pulling in changes from the mkdocs-material theme. It can only be executed in a Linux shell. More usage information is provided by the help menu:
7692

0 commit comments

Comments
 (0)