# .readthedocs.yaml
# Read the Docs configuration file
# 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-24.04
  tools:
    python: "mambaforge-latest"
  apt_packages:
    - autoconf
    - automake
    - build-essential
    - libtool
    - gengetopt
    - help2man
    - python3-myst-parser
  jobs:
    pre_build:
      - tar -xjf src/dlib-20.0.tar.bz2 -C src/
      - tar -xzf src/libsvm-3.35.tar.gz -C src/
      - autoreconf -i && ./configure --without-forester --without-kinfold --without-rnalocmin --without-rnaxplorer --without-cla --without-perl --without-python2 --disable-lto
      - cd src/ViennaRNA && make -j && cd ../../
      - cd doc/doxygen && make && cd ../../
      - cd interfaces/Python && make V=1 && cd ../../
      - cd man && make && cd ../
      - cd doc/source/man && make && cd ../../../
      - cd doc && make refman-html && cd ../

conda:
  environment: doc/rtd_environment.yaml

python:
  install:
    - requirements: doc/requirements.txt

# Build documentation in the docs/ directory with Sphinx
sphinx:
   configuration: doc/conf.py
