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

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

concurrency:
# Same scheme as ci.yml: each push to main gets its own group, so deploys
# never cancel each other; other events supersede older runs.
group: >-
${{ github.workflow }}-${{ github.event_name == 'push' && github.sha ||
github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 3

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # hatch-vcs needs tags for the version

- name: Install uv
uses: astral-sh/setup-uv@702b425af1c366e68b4a9449a8de6dd98b63e979 # v7.1.2
with:
python-version: "3.13"

- name: Install dependencies
run: uv sync --no-default-groups --group docs --locked

- name: Build docs
run: uv run --frozen zensical build --clean

- name: Upload Pages artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site

deploy:
name: Deploy
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
5 changes: 5 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# API

::: xmmutablemap.ImmutableMap

::: xmmutablemap.frozendict
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Home
---

--8<-- "README.md"
57 changes: 57 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
site_name: xmmutablemap
site_description: An immutable mapping that JAX understands as a PyTree.
site_url: https://galacticdynamics.github.io/xmmutablemap
repo_url: https://github.com/GalacticDynamics/xmmutablemap
repo_name: GalacticDynamics/xmmutablemap
edit_uri: ""

theme:
name: material
features:
- navigation.sections
- toc.integrate
palette:
- scheme: default
primary: white
accent: teal
toggle:
icon: material/weather-night
name: Switch to dark mode
- scheme: slate
primary: black
accent: teal
toggle:
icon: material/weather-sunny
name: Switch to light mode
icon:
repo: fontawesome/brands/github
logo: _static/favicon.svg
favicon: _static/favicon.svg

markdown_extensions:
- admonition
- github-callouts # render the README's > [!WARNING] alerts
- pymdownx.details
- pymdownx.superfences
- pymdownx.snippets: # index.md pulls in the README
check_paths: true
- toc:
permalink: "陇"
toc_depth: 3

plugins:
- search
- mkdocstrings:
handlers:
python:
options:
docstring_style: numpy
heading_level: 2
members_order: source
show_root_heading: true
show_source: false
show_signature_annotations: true

nav:
- index.md
- API: api.md
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@ dev = [
"ipykernel>=6.29.5",
"cz-conventional-gitmoji>=0.6.1",
{include-group = "build"},
{include-group = "docs"},
{include-group = "lint"},
{include-group = "nox"},
{include-group = "test"},
]
build = [
"build>=1.3.0",
]
docs = [
"markdown-callouts>=0.4.0",
"mkdocstrings[python]>=1.0.4",
"pymdown-extensions>=11.0.1",
"zensical",
]
lint = [
"mypy>=1.19.0",
"prek>=0.5.3",
Expand Down
Loading
Loading