Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit a1060f8

Browse files
committed
docs: add new config to docs & document development setup
1 parent d9ad148 commit a1060f8

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,34 @@ plugins:
5555
Be advised that in case of any customization on your part you need to include the default attributes as well if you want
5656
to keep them, as the default list will not be included automatically anymore.
5757

58+
If `site:` as the prefix does not work for you for any reason, you can also configure that,
59+
e.g.
60+
61+
```yaml
62+
plugins:
63+
- site-urls:
64+
prefix: "relative:"
65+
```
66+
67+
This can also be used to interpret absolute URLs like `/example/file.png` as relative,
68+
by setting the `prefix` to `/`.
69+
5870
## How it works
5971

6072
The plugin hooks into the [`on_page_content` event](https://www.mkdocs.org/dev-guide/plugins/#on_page_content)
6173
and replaces all URLs in the configured attributes (by default `href`, `src` or `data`) in the rendered HTML with the corresponding site-relative URLs.
6274

75+
## Development
76+
77+
1. Create a venv & activate it, e.g. `python -m venv venv && source venv/bin/activate`
78+
2. Install the dev requirements: `pip install -r requirements-dev.txt`
79+
3. Install the `pre-commit` hooks: `pre-commit install`
80+
81+
You can run the tests with `pytest`.
82+
83+
To build the docs, install their dependencies as well (`pip install -r requirements-docs.txt`),
84+
then run `mkdocs build`.
85+
6386
## License
6487

6588
This project is licensed under the MIT license, see the [LICENSE](https://github.com/OctoPrint/mkdocs-site-urls/blob/main/LICENSE) file for details.

requirements-dev.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pre-commit
2+
pytest
3+
-e .

0 commit comments

Comments
 (0)