Skip to content

Commit bfb1e15

Browse files
ci: Use uv rather than a Dockerfile for mkdocs
1 parent 153eaa2 commit bfb1e15

File tree

8 files changed

+673
-48
lines changed

8 files changed

+673
-48
lines changed

.github/ci_generator/templates/job_steps/build_docs.jinja

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,13 @@
99
run: |
1010
mkdir -p docs/api_reference
1111
cp -r target/doc/* docs/api_reference
12-
- name: Set up QEMU
13-
uses: docker/setup-qemu-action@v3
14-
- name: Set up Docker Buildx
15-
uses: docker/setup-buildx-action@v3
16-
- name: Build and export to Docker
17-
uses: docker/build-push-action@v5
18-
with:
19-
context: docs/
20-
load: true
21-
tags: pavex-docs
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v6
14+
- name: Install the project
15+
run: uv sync --locked
2216
- name: Build docs
2317
run: |
24-
docker run --rm -v ${PWD}:/docs pavex-docs build --strict
18+
uv run mkdocs build --strict
2519
- uses: actions/upload-artifact@v4
2620
with:
2721
name: docs
@@ -45,6 +39,7 @@
4539
--exclude-path="site/api_reference/pavex/time"
4640
--exclude-path="site/api_reference/help.html"
4741
--exclude-path="site/api_reference/settings.html"
42+
--exclude-path="site/404.html"
4843
--exclude=".*crate#per-style$"
4944
--exclude="https://doc.rust-lang.org/*"
5045
--exclude="https://stackoverflow.com/*"

.github/workflows/docs.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,19 +1717,13 @@ jobs:
17171717
run: |
17181718
mkdir -p docs/api_reference
17191719
cp -r target/doc/* docs/api_reference
1720-
- name: Set up QEMU
1721-
uses: docker/setup-qemu-action@v3
1722-
- name: Set up Docker Buildx
1723-
uses: docker/setup-buildx-action@v3
1724-
- name: Build and export to Docker
1725-
uses: docker/build-push-action@v5
1726-
with:
1727-
context: docs/
1728-
load: true
1729-
tags: pavex-docs
1720+
- name: Install uv
1721+
uses: astral-sh/setup-uv@v6
1722+
- name: Install the project
1723+
run: uv sync --locked
17301724
- name: Build docs
17311725
run: |
1732-
docker run --rm -v ${PWD}:/docs pavex-docs build --strict
1726+
uv run mkdocs build --strict
17331727
- uses: actions/upload-artifact@v4
17341728
with:
17351729
name: docs
@@ -1753,6 +1747,7 @@ jobs:
17531747
--exclude-path="site/api_reference/pavex/time"
17541748
--exclude-path="site/api_reference/help.html"
17551749
--exclude-path="site/api_reference/settings.html"
1750+
--exclude-path="site/404.html"
17561751
--exclude=".*crate#per-style$"
17571752
--exclude="https://doc.rust-lang.org/*"
17581753
--exclude="https://stackoverflow.com/*"

docs/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM squidfunk/mkdocs-material:9
22
RUN pip install mkdocs-awesome-pages-plugin
3+
RUN pip install mike
34
RUN pip install pygments_ansi_color
45
RUN pip install "mkdocs-material[imaging]"
56
COPY tools/md_slash ${PACKAGES}/md_slash

docs/tools/md_slash/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "md-slash"
2+
name = "md_slash"
33
version = "0.1.0"
44
readme = "README.md"
55
description = "MkDocs extension to convert trailing slashes to <br>"
@@ -8,7 +8,7 @@ requires-python = ">=3.11"
88
dependencies = ["Markdown"]
99

1010
[project.entry-points."markdown.extensions"]
11-
trailing_slash = "md-slash:makeExtension"
11+
trailing_slash = "md_slash:makeExtension"
1212

1313
[build-system]
1414
requires = ["hatchling"]

docs/tools/md_slash/uv.lock

Lines changed: 0 additions & 23 deletions
This file was deleted.

mkdocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
site_name: Pavex
2-
site_url: "https://pavex.dev/"
2+
site_url: "https://pavex.dev/docs/"
33
site_description: "The documentation for Pavex, a framework for building robust APIs in Rust."
44
repo_url: "https://github.com/LukeMathWalker/pavex"
55
repo_name: "LukeMathWalker/pavex"
66
edit_uri: "edit/main/docs/"
77
plugins:
88
# - social
99
- search
10+
- mike:
11+
canonical_version: "latest"
1012
- redirects:
1113
redirect_maps:
1214
"index.md": "overview/index.md"
15+
extra:
16+
version:
17+
provider: "mike"
1318
markdown_extensions:
1419
- admonition
1520
- pymdownx.details

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[project]
2+
name = "pavex"
3+
version = "0.1.0"
4+
requires-python = ">=3.13"
5+
dependencies = [
6+
"mike>=2.1.3",
7+
"mkdocs-awesome-pages-plugin>=2.10.1",
8+
"mkdocs-material>=9.6.23",
9+
"mkdocs-redirects>=1",
10+
"pymdown-extensions>=10",
11+
"pygments-ansi-color>=0.3.0",
12+
"pip>=25",
13+
"md_slash"
14+
]
15+
16+
[project.entry-points."markdown.extensions"]
17+
trailing_slash = "md_slash:makeExtension"
18+
19+
[tool.uv.sources]
20+
md_slash = { workspace = true }
21+
22+
[tool.uv.workspace]
23+
members = ["docs/tools/md_slash"]

0 commit comments

Comments
 (0)