diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml deleted file mode 100644 index 8530671..0000000 --- a/.github/workflows/build-docs.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow installs the package and builds the docs -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Build the docs - -on: - push: - branches: [ 'main' ] - pull_request: - branches: [ '**' ] - -jobs: - sphinx: - strategy: - matrix: - os: - - ubuntu-latest - python-version: - - '3.10' - - fail-fast: false - - - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} py${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies and package for building the docs - run: pip install -r requirements.txt - - - name: Build the docs - run: make html diff --git a/conf.py b/conf.py index ccefaa4..e3a33bc 100644 --- a/conf.py +++ b/conf.py @@ -10,11 +10,10 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os # import sys # sys.path.insert(0, os.path.abspath('.')) - import datetime +import os # -- Project information ----------------------------------------------------- @@ -38,7 +37,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns: list[str] = [] # -- Intersphinx ------------------------------------------------------------- @@ -69,10 +68,19 @@ "iiasa.css", ] +# Define the canonical URL if you are using a custom domain on Read the Docs +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + if "html_context" not in globals(): + html_context = {} + html_context["READTHEDOCS"] = True + # prolog for all rst files rst_prolog = """ .. |br| raw:: html
-""" \ No newline at end of file +"""