Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "source-read" being emitted for included docs #57

Merged
merged 1 commit into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ Caveats

See also `issue #1`_.

* A regression in Sphinx version 7.2 prevents the extension from working
properly when using the ``.. include`` directive. See `Sphinx issue
#11643`_.

* In Sphinx versions 5.0 and 5.1, there has been
a regression in how dependencies are determined.
This could lead to spurious dependencies
Expand Down Expand Up @@ -117,3 +121,4 @@ Similar stuff
guides/feature-flags.html
.. _issue #1: https://github.com/mgeier/sphinx-last-updated-by-git/issues/1
.. _issue #40: https://github.com/mgeier/sphinx-last-updated-by-git/issues/40
.. _Sphinx issue #11643: https://github.com/sphinx-doc/sphinx/issues/11643
6 changes: 4 additions & 2 deletions src/sphinx_last_updated_by_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ def _builder_inited(app):

def _source_read(app, docname, source):
env = app.env
assert docname not in env.git_last_updated
env.git_last_updated[docname] = None
# Since Sphinx 7.2, the source-read hook can be called multiple times
# when using .. include
if docname not in env.git_last_updated:
env.git_last_updated[docname] = None


def _env_merge_info(app, env, docnames, other):
Expand Down