get_project_content_commit_date

documenteer.sphinxconfig.utils.get_project_content_commit_date(root_dir='.', exclusions=None)

Get the datetime for the most recent commit to a project that affected Sphinx content.

Content is considered any file with one of these extensions:

  • rst (README.rst and LICENSE.rst are excluded)

  • ipynb

  • png

  • jpeg

  • jpg

  • svg

  • gif

This function allows project infrastructure and configuration files to be updated without changing the timestamp.

Parameters
  • root_dir (str, optional) – Root directory. This is the current working directory by default.

  • exclusions (list of str, optional) – List of file paths or directory paths to ignore.

Returns

commit_date – Datetime of the most recent content commit.

Return type

datetime.datetime

Raises

RuntimeError – Raised if no content files are found.