-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Issue
When using codeautolink_custom_blocks
, which is supposed to be a dictionary containing a callable, Sphinx will re-build all HTML files every time it is running, even if no source files have changed.
Expected behavior
No re-building of HTML files if nothing changes.
Steps to reproduce
Add this to conf.py
:
codeautolink_custom_blocks = {
'python': lambda x: (x, x),
}
Run Sphinx.
Run Sphinx again. Notice that the HTML files are re-built even though nothing changed
Possible solutions
The current behavior should be kept for backwards compatibility, but probably in addition to a callable, a string could also be supported?
This could probably be implemented using sphinx.util.import_object()
(for an example see https://github.com/spatialaudio/nbsphinx/blob/44829f13d18e676917fc6e7b7ae62d4bac625cd7/src/nbsphinx.py#L990-L991).
For a bit more background (I was struggling with this some time ago), see this mailing list thread: https://groups.google.com/g/sphinx-dev/c/aGfJb-TC8PI/m/zxM3l9kAAgAJ