|
4 | 4 | 2. Open an issue if your query has not been previously addressed. |
5 | 5 | 3. If a solution is found, and requires changes to this repository, then submit a Pull Request. |
6 | 6 |
|
7 | | -## Code style |
| 7 | +## Unwanted changes |
8 | 8 |
|
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. |
10 | 10 |
|
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. |
12 | 12 |
|
13 | | -### Using `nox` & `npm` |
| 13 | +## Required development tools |
14 | 14 |
|
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: |
17 | 16 |
|
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) |
19 | 19 |
|
20 | | -Be sure `nox` is installed via `pip install nox`. |
| 20 | +The rest of this document will assume that these tools are installed. |
21 | 21 |
|
22 | | -From the repository root directory: |
| 22 | +### Setup a venv |
23 | 23 |
|
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 |
26 | 28 | ``` |
27 | 29 |
|
28 | | -More info is available via `nox -h` or [their documentation](https://nox.thea.codes/en/stable/usage.html). |
| 30 | +### Setup node.js |
29 | 31 |
|
30 | | -#### Run type checkers and formatters for JS & SCSS |
| 32 | +Install the node.js dependencies (used for development): |
31 | 33 |
|
32 | | -```shell |
33 | | -npm run check |
| 34 | +```text |
| 35 | +npm install |
34 | 36 | ``` |
35 | 37 |
|
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): |
37 | 39 |
|
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 | +``` |
39 | 43 |
|
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 |
41 | 45 |
|
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. |
43 | 47 |
|
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). |
45 | 49 |
|
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 |
49 | 51 |
|
50 | | -Setup the Python venv: |
| 52 | +The following command uses the venv prepared as directed in [setup a venv](#setup-a-venv): |
51 | 53 |
|
52 | | -```text |
53 | | -uv sync |
| 54 | +```shell |
| 55 | +uv run nox |
54 | 56 | ``` |
55 | 57 |
|
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). |
57 | 59 |
|
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 |
61 | 64 | ``` |
62 | 65 |
|
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: |
64 | 76 |
|
65 | 77 | ```text |
66 | 78 | uv run nox -s "docs(html)" |
67 | 79 | ``` |
68 | 80 |
|
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. |
70 | 86 |
|
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. |
72 | 88 |
|
73 | | -### Merging in changes from upstream |
| 89 | +## Merging in changes from upstream |
74 | 90 |
|
75 | 91 | 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: |
76 | 92 |
|
|
0 commit comments