Description
Describe the bug
Hi, I'm the author of sphinx-codeautolink, a package that injects links into code examples in HTML output. We rely on Builder.get_outdated_docs
to optimise the processing (which is done in the build-finished
event). Since exactly version 7.3.7 Sphinx has started overwriting all the HTML files if there's even one outdated file, leading to a bug in repeat builds.
Curiously, with version 7.3.6 (which works for the extension) if I edit the HTML file manually to e.g. change the title and rebuild, my edit is overwritten too. This leads me to believe that Sphinx is somehow tracking the resulting HTML and overwriting if necessary - and that the checkpoint for that tracking has changed. So if this is not considered a bug, is there a way I can still implement HTML post-processing with awareness for outdated documents?
How to Reproduce
# conf.py
extensions = ["sphinx.ext.intersphinx", "sphinx_codeautolink"]
intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}
Title
-----
.. code:: python
import re
re.match()
.. toctree::
:hidden:
another
Another
-------
- pip install sphinx==7.3.6 sphinx-codeautolink
- sphinx-build src build
- open index.html and see links generated
- edit "another.rst" to e.g. include content under the title and rebuild
- open index.html and see the links are still there
Repeat with sphinx==7.3.7
and the links after the second build are no longer there.
Environment Information
None beyond the sphinx versions mentioned above.
Sphinx extensions
sphinx-codeautolink
Additional context
No response