diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 7aa2a619e..9ca8d8b8a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -20,6 +20,9 @@ build: python: "mambaforge-22.9" commands: + # With shallow clone the "Last updated" timestamps can not get computed + # See "Caveats" at + - "git fetch --unshallow || true" - "mamba env create --file conda-environment.yml --force" - "mamba run --name mxcubeweb poetry install --only=docs,main" - "(mamba run --name mxcubeweb redis-server &) && mamba run --name mxcubeweb python -m sphinx -T -E -b html -d _build/doctrees -c docs docs/source ${READTHEDOCS_OUTPUT}/html && mamba run --name mxcubeweb redis-cli shutdown" diff --git a/docs/conf.py b/docs/conf.py index 5ef9ae412..7a4920174 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,7 +6,6 @@ import mxcubeweb - MXCUBE_NAME = "MXCuBE" MXCUBE_CORE_NAME = f"{MXCUBE_NAME}-Web" MXCUBE_WEB_NAME = f"{MXCUBE_NAME}-Web" @@ -122,4 +121,10 @@ extensions.append("sphinxcontrib.autohttp.flask") +# -- Options for sphinx_last_updated_by_git +# https://pypi.org/project/sphinx-last-updated-by-git/ + +extensions.append("sphinx_last_updated_by_git") + + # EOF diff --git a/poetry.lock b/poetry.lock index 8db48e09b..fe58e8247 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "alabaster" @@ -2909,6 +2909,20 @@ sphinx = ">=4.0" [package.extras] docs = ["furo", "ipython", "myst-parser", "sphinx-copybutton", "sphinx-inline-tabs"] +[[package]] +name = "sphinx-last-updated-by-git" +version = "0.3.7" +description = "Get the \"last updated\" time for each Sphinx page from Git" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sphinx_last_updated_by_git-0.3.7-py3-none-any.whl", hash = "sha256:9937f235911aaec566a652b26952b29f530abb86f98e0fb67843227301636457"}, + {file = "sphinx_last_updated_by_git-0.3.7.tar.gz", hash = "sha256:edfd4970d9778123d3d0d9c5c9a9e3d700867a080539eb2bfe01e7078ca1dc78"}, +] + +[package.dependencies] +sphinx = ">=1.8" + [[package]] name = "sphinxcontrib-applehelp" version = "1.0.4" @@ -3454,4 +3468,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.11" -content-hash = "0882308efd95fd2e259e908401eef981d9c98b3ab641f6c19b37c5e55fd22163" +content-hash = "a8e16bafcae55910ab74c85015e23a4fa1c5124e47e74ac511606de43dce9c8f" diff --git a/pyproject.toml b/pyproject.toml index 1bb16b5b6..0ec9fc062 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,10 +49,11 @@ pytest = "7.1.3" pytest-cov = "4.0.0" [tool.poetry.group.docs.dependencies] +furo = "^2023.9.10" myst-parser = "^2.0.0" sphinx = "<7.2" +sphinx-last-updated-by-git = "^0.3.7" sphinxcontrib-httpdomain = "^1.8.1" -furo = "^2023.9.10" [tool.black] line-length = 88