Skip to content

Commit 1ee5c96

Browse files
committed
🎨 mark relative files correctly, remove relative directory links
- directory links cannot be meaningfully resolved - relative files will be available for download - ./ denotes a relative file path So file links in GitHub or VSCode still work and it's rendered better in the documenation now
1 parent b4e3412 commit 1ee5c96

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

developing.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ python_package
4040

4141
## Core packaging files
4242

43-
We will first look at [`pyproject.toml`](pyproject.toml) and its relation to the
44-
[`src`](src) directory. The
45-
[`pyproject.toml`](pyproject.toml) file is the main configuration file for the Python package
43+
We will first look at [`pyproject.toml`](./pyproject.toml) and its relation to the
44+
`src` directory. The
45+
[`pyproject.toml`](./pyproject.toml) file is the main configuration file for the Python package
4646
and is used to specify the package metadata, dependencies, build tools and configurations.
47-
The [`src`](src) folder stores the actual source code of the package, where the package itself is
48-
the subdirectories of the [`src`](src) directory. The (e.g. `src/python_package`).
47+
The `src` folder stores the actual source code of the package, where the package itself is
48+
the subdirectories of the `src` directory. The (e.g. `src/python_package`).
4949

5050
<details>
5151
<summary>About <code>setup.py</code> and <code>setup.cfg</code> configuration files</summary>
5252

53-
The [`setup.py`](setup.py) file is an artefact for backward compatibility and should not
54-
be changed. Everything that used to be in [`setup.py`](setup.py) or
55-
[`setup.cfg`](setup.cfg) is now largely in [`pyproject.toml`](pyproject.toml).
53+
The [`setup.py`](./setup.py) file is an artefact for backward compatibility and should not
54+
be changed. Everything that used to be in [`setup.py`](./setup.py) or
55+
[`setup.cfg`](./setup.cfg) is now largely in [`pyproject.toml`](./pyproject.toml).
5656
The notable exception would be the desired maximum line length in `setup.cfg` for
5757
the tool [`flake8`](https://flake8.pycqa.org/), which does not yet supported
58-
[`pyproject.toml`](pyproject.toml) configuration. As we use `ruff` as linter,
58+
[`pyproject.toml`](./pyproject.toml) configuration. As we use `ruff` as linter,
5959
we left it empty, but in case you want to use `flake8`, you can add:
6060

6161
```INI
@@ -116,13 +116,13 @@ dynamic = ["version"]
116116

117117
means that the version is loaded dynamically using the extension
118118
[setuptools_scm](https://setuptools-scm.readthedocs.io/)
119-
we list under the `[build-system]` section in [`pyproject.toml`](pyproject.toml).
119+
we list under the `[build-system]` section in [`pyproject.toml`](./pyproject.toml).
120120
This is done to avoid having to manually update the version and integrate with automatic
121121
versioning through releases on GitHub. It also
122122
ensures that each commit has a unique version number, which is useful for attributing
123123
errors to specific non-released versions. The dynamic version is picked up in the
124124
`__version__` variable in the `__init__.py` file of the package, which is located in the
125-
[`src/python_package`](src/python_package) directory.
125+
`src/python_package` directory.
126126

127127
```toml
128128
[build-system]
@@ -182,7 +182,7 @@ in the same project under the `python_package` package (see example
182182
```
183183

184184
So you will need to rename the `python_package` directory to your package name,
185-
e.g. `my_package` and specify the package name in the [`pyproject.toml`](pyproject.toml) file
185+
e.g. `my_package` and specify the package name in the [`pyproject.toml`](./pyproject.toml) file
186186
under the `[project]` section:
187187

188188
```toml
@@ -191,7 +191,7 @@ name = "my_package"
191191

192192
Strictly speaking you can give different names in both places, but this will only confuse
193193
potential users. Think of `scikit-learn` for an example of a package that uses a different
194-
name in the [`pyproject.toml`](pyproject.toml) file and the source code directory name,
194+
name in the [`pyproject.toml`](./pyproject.toml) file and the source code directory name,
195195
leading to the `sklearn` package name when imported.
196196

197197
## Documentation
@@ -200,8 +200,8 @@ The documentation is created using [Sphinx](https://www.sphinx-doc.org/en/master
200200
which is common for Python documentation. It relies additionally on several extensions
201201
enabling the use of `markdown` and `jupyter` notebooks.
202202

203-
The documentation is located in the [`docs`](docs) directory. Sphinx is configured via
204-
the [`conf.py`](docs/conf.py) file, where you can specify the extension you want:
203+
The documentation is located in the `docs` directory. Sphinx is configured via
204+
the [`conf.py`](./docs/conf.py) file, where you can specify the extension you want:
205205

206206
```python
207207
# in docs/conf.py
@@ -237,7 +237,7 @@ docs = [
237237

238238
### Required changes in `conf.py`
239239

240-
The required changes in [`conf.py`](docs/conf.py) are at the following places:
240+
The required changes in [`conf.py`](./docs/conf.py) are at the following places:
241241

242242
```python
243243
# in docs/conf.py
@@ -273,8 +273,8 @@ package on the fly. See the Read The Docs section below for more details.
273273

274274
We build the documentation based on the template
275275
[sphinx_book_theme](https://sphinx-book-theme.readthedocs.io), which is set in the
276-
[`conf.py`](docs/conf.py) file and parts of our docs requirements in
277-
[`pyproject.toml`](pyproject.toml):
276+
[`conf.py`](./docs/conf.py) file and parts of our docs requirements in
277+
[`pyproject.toml`](./pyproject.toml):
278278

279279
```python
280280
html_theme = "sphinx_book_theme"
@@ -308,8 +308,8 @@ like `pandas`, `scikit-learn`, or `matplotlib` to the mapping.
308308
### Building the documentation locally (with integration tests)
309309

310310
To build the documentation locally, you can follow the instructions in the
311-
[`docs/README.md`](docs/README.md), which you should also update with your name changes.
312-
In short, you can run the following commands in the [`docs`](docs ) directory:
311+
[`docs/README.md`](./docs/README.md), which you should also update with your name changes.
312+
In short, you can run the following commands in the `docs` directory:
313313

314314
```bash
315315
# in root of the project
@@ -320,7 +320,7 @@ sphinx-build -n -W --keep-going -b html ./ ./_build/
320320
```
321321

322322
this will create a `reference` directory with the API documentation of the Python package
323-
`python_package`, a `jupyter_execute` for the tutorial in [`docs/tutorial`](docs/tutorial)
323+
`python_package`, a `jupyter_execute` for the tutorial in `docs/tutorial`
324324
and a `_build` directory with an HTML version of the documentation. You can open the
325325
`_build/index.html` file in your browser to view the documentation built locally.
326326

@@ -356,15 +356,15 @@ You have to keep the files in sync using:
356356
jupytext --sync docs/tutorial/*.ipynb
357357
```
358358

359-
The [`docs/tutorial/.jupytext`](docs/tutorial/.jupytext) configuration sets the default
359+
The [`docs/tutorial/.jupytext`](./docs/tutorial/.jupytext) configuration sets the default
360360
format to `py:percent` and automatically allows syncing of new notebooks.
361361

362362
### Read The Docs
363363

364364
To build the documentation on Read The Docs, you need to create a file called
365-
[`.readthedocs.yaml`](.readthedocs.yaml), which is located in the root of the project and
365+
[`.readthedocs.yaml`](./.readthedocs.yaml), which is located in the root of the project and
366366
specifies which dependencies are needed. The core is the following specifying where the
367-
[`conf.py`](docs/conf.py) file is and from where to install the required dependencies:
367+
[`conf.py`](./docs/conf.py) file is and from where to install the required dependencies:
368368

369369
```yaml
370370
# Build documentation in the "docs/" directory with Sphinx
@@ -384,7 +384,7 @@ You will need to manually register your project repository on
384384
by the service. I recommend to activate builds for Pull Requests, so that
385385
the documentation is built for each PR and you can see if the documentation is gradually
386386
breaking, i.e. your integration test using the notebooks in
387-
[`docs/tutorial`](docs/tutorial) fail. See their documentation
387+
`docs/tutorial` fail. See their documentation
388388
[on adding a project](https://docs.readthedocs.com/platform/stable/intro/add-project.html)
389389
for instructions.
390390

@@ -414,7 +414,7 @@ read the next section to see how this is automated using `GitHub Actions`.
414414
## GitHub Actions
415415

416416
We run these checks also on GitHub using GitHub Actions. The configuration
417-
for the actions is located in the [`.github/workflows`](.github/workflows) directory
417+
for the actions is located in the `.github/workflows` directory
418418
and is specified in the `cdci.yml` file. See the biosustain dsp tutorial on GitHub Actions
419419
for more details (or any other resource you find):
420420
[biosustain/dsp_actions_tutorial](https://github.com/biosustain/dsp_actions_tutorial)

docs/developing.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
<!--
2+
See on how to use include:
3+
https://myst-parser.readthedocs.io/en/latest/faq/index.html#include-a-file-from-outside-the-docs-folder-like-readme-md
4+
-->
15
```{include} ../developing.md
26
:start-line: 0
3-
:relative-docs: www.rasmussenlab.com/python_package/docs
7+
:relative-docs: ./
48
:relative-images:
59
```

0 commit comments

Comments
 (0)