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: mxcube#899
  • Loading branch information
fabcor-maxiv committed Jun 14, 2024
1 parent 0600d5a commit 9fe2805
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:

- name: "Checkout"
uses: "actions/checkout@v4" # tested with v4.1.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

- name: "Set up Python 3.8"
uses: "actions/setup-python@v4" # tested with v4.7.0
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-dev.yml --force"
- "mamba run --name mxcubecore poetry install --only=docs,main"
- "mamba run --name mxcubecore sphinx-build -T -E -b html -c ./docs/ ./docs/source/ ${READTHEDOCS_OUTPUT}/html/"
Expand Down
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import datetime
import importlib.metadata


PROJECT_PACKAGE_NAME = "mxcubecore"
PROJECT_PACKAGE_METADATA = importlib.metadata.metadata(PROJECT_PACKAGE_NAME)

Expand Down Expand Up @@ -103,4 +102,10 @@
myst_enable_extensions = ("fieldlist",)


# -- Options for sphinx_last_updated_by_git
# https://pypi.org/project/sphinx-last-updated-by-git/

extensions.append("sphinx_last_updated_by_git")


# EOF
16 changes: 15 additions & 1 deletion 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 @@ -58,9 +58,10 @@ pytest-cov = "^4.0.0"
pytest-mock = "^3.10.0"

[tool.poetry.group.docs.dependencies]
furo = "^2023.9.10"
myst-parser = "^2.0.0"
sphinx = "<7.2"
furo = "^2023.9.10"
sphinx-last-updated-by-git = "^0.3.7"

[tool.poetry.extras]
tango = ["PyTango"]
Expand Down

0 comments on commit 9fe2805

Please sign in to comment.