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

set fallback := true

python := "python"

# Lock documentation dependencies for running in CI.
[arg("args", help="Arguments passed to pip-compile")]
[env("CUSTOM_COMPILE_COMMAND", "just docs lock")]
lock *args:
    {{ python }} -m piptools compile \
    --strip-extras --extra=docs \
    --output-file=requirements.txt \
    {{ args }} \
    ../pyproject.toml

# Build documentation.
[arg("args", help="Arguments passed to sphinx")]
build *args:
    {{ python }} -m sphinx . _build {{ args }}

# Format documentation source files
format:
    {{ python }} -m black conf.py
    just --fmt --unstable
