# Read the Docs configuration file for MkDocs projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
  os: ubuntu-22.04
  tools:
    python: "3.12"
  jobs:
    install:
      - python install-pdm.py --path ~/.local/pdm
      - ~/.local/pdm/bin/pdm --version
      - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH ~/.local/pdm/bin/pdm install -dG doc
    build:
      html:
        - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH ~/.local/pdm/bin/pdm run python tasks/render_reference_docs.py
        - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH ~/.local/pdm/bin/pdm run zensical build
        - mkdir --parents $READTHEDOCS_OUTPUT/html/
        - cp --recursive site/. $READTHEDOCS_OUTPUT/html/
