Skip to content

Commit

Permalink
Add a "last updated at" timestamp in doc pages
Browse files Browse the repository at this point in the history
GitHub: related to mxcube/mxcubecore#899
  • Loading branch information
fabcor-maxiv committed Jun 14, 2024
1 parent c74d064 commit a45ee3f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:

- name: "Checkout"
uses: "actions/checkout@v4" # tested with v4.0.0
with:
# With shallow clone the "Last updated" timestamp can not get computed
# See "Caveats" at https://pypi.org/project/sphinx-last-updated-by-git
fetch-depth: 0

# Use micromamba instead of conda for better performance
- name: "Setup conda environment with micromamba"
Expand Down
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ build:
python: "mambaforge-22.9"

commands:
# With shallow clone the "Last updated" timestamps can not get computed
# See "Caveats" at <https://pypi.org/project/sphinx-last-updated-by-git/>
- "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"
Expand Down
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import mxcubeweb


MXCUBE_NAME = "MXCuBE"
MXCUBE_CORE_NAME = f"{MXCUBE_NAME}-Web"
MXCUBE_WEB_NAME = f"{MXCUBE_NAME}-Web"
Expand Down Expand Up @@ -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
18 changes: 16 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a45ee3f

Please sign in to comment.