Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/macros.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import tomllib
from pathlib import Path

from mkdocs_macros.plugin import MacrosPlugin


def define_env(env: MacrosPlugin) -> None:
project = tomllib.loads(
(Path(__file__).parent.parent / "pyproject.toml").read_text(encoding="utf-8")
)
env.variables["package_version"] = project["project"]["version"]
2 changes: 1 addition & 1 deletion docs/tutorial/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contains a selection of basic problems. We can install it with uv just like the
package:

```console
uv tool install --with algobattle-problems algobattle-base==4.4.2
uv tool install --with algobattle-problems algobattle-base=={{ package_version }}
```

## Setting up the workspace
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ whichever installation process and version you like.
Then all we need to do is run this command:

```console
uv tool install algobattle-base==4.4.2
uv tool install algobattle-base=={{ package_version }}
```

This will take care of installing the correct Python version and all dependencies we need. It also
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ edit_uri: ""

plugins:
- search

- macros:
module_name: docs/macros
- mkdocstrings:
handlers:
python:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dev = [
"pymdown-extensions>=12.1.0",
"mkdocstrings[python]>=1.0.6",
"mdx-include>=1.4.2",
"mkdocs-macros-plugin>=1.5.0",
]


Expand Down
53 changes: 53 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading