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
70 changes: 70 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Documentation

# Deploy the docs only after a successful release (the "Publish" workflow,
# which runs on version tags and publishes to PyPI). Also allow manual runs.
on:
workflow_run:
workflows: ["Publish"]
types: ["completed"]
workflow_dispatch:

# Allow the GITHUB_TOKEN to deploy to GitHub Pages.
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment, without cancelling in-progress runs so a
# deploy is always allowed to finish.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
name: "Build & deploy docs"
runs-on: "ubuntu-latest"

# For workflow_run, only proceed when the triggering release succeeded.
# Manual runs (workflow_dispatch) are always allowed.
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Build the exact commit that was released. workflow_run defaults to
# the default branch, which may have advanced past the release tag.
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.10"

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.10"
version: "0.11.7"

- name: "Install dependencies"
run: uv sync --all-extras --dev

- name: "Build docs"
run: uv run zensical build --clean --strict

- name: "Configure GitHub Pages"
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
with:
enablement: true

- name: "Upload Pages artifact"
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site

- name: "Deploy to GitHub Pages"
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
4 changes: 4 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: API
---

::: httpx_retries
options:
members:
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ This runs:

## Documentation

Documentation is built using MkDocs. To preview locally:
Documentation is built using [Zensical](https://zensical.org). To preview locally:

```shell
mkdocs serve
zensical serve
```

Then visit `http://127.0.0.1:8000` in your browser.
Expand Down
5 changes: 5 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Links that wrap an image (e.g. the badge row on the home page) shouldn't
get the body-link underline. */
.md-typeset a:has(> img) {
text-decoration: none;
}
45 changes: 0 additions & 45 deletions mkdocs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev = [
"mypy",
"pytest",
"pytest-asyncio",
"mkdocs-material",
"zensical>=0.0.47",
"mkdocstrings[python]",
"pygments",
"coverage",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -euo pipefail

uv build --no-sources
uv run mkdocs build
uv run zensical build --clean --strict
5 changes: 4 additions & 1 deletion scripts/publish
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
fi

uv publish
uv run mkdocs gh-deploy --force

# Documentation is published separately by .github/workflows/docs.yml, which
# builds the site with Zensical and deploys it to GitHub Pages via the Pages
# deployment actions on every push to main.

echo "Done! 🎉"
Loading
Loading