#!/usr/bin/env just --justfile

set fallback

# Format documentation source files
format:
    black conf.py
    mdformat .
    '{{ just_executable() }}' --fmt --unstable

sphinx_module := "sphinx"

# Build documentation.
build *args:
    python -m {{ sphinx_module }} --doctree-dir=_doctrees {{ args }} . _build

# Push documentation version
push *args:
    docput --log-level=DEBUG version push _build {{ args }}

# Update root files for the documentation site
update-root *args:
    docput upload --merge _root . {{ args }}
