You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, we use app.config.templates_path, which by default is ['_templates'], where _templates is supposed to be relative to the folder in which conf.py resides. However, we use it here as a path relative to the current working directory. Generally, there will be no folder _templates in the current working directory, so the extension falls back to str(Path(__file__).parent / '_template', i.e. the built-in default template. The custom template will not be used, and there will be no warning.
Strangely, the tests didn't catch this, even though we explicitly tests that custom templates work. This must be some weird detail of sphinx-testing. 🤷
The text was updated successfully, but these errors were encountered:
It appears that the
doctr_versions_menu
extension will not use a customdoctr-versions-menu.js_t
in thetemplates_path
defined in Sphinx'conf.py
.The problem is in the following code:
https://github.com/goerz/doctr_versions_menu/blob/63ec6aa0037b1c62cf46ba632a56a59f17700aac/src/doctr_versions_menu/ext.py#L26-L28
Here, we use
app.config.templates_path
, which by default is['_templates']
, where_templates
is supposed to be relative to the folder in whichconf.py
resides. However, we use it here as a path relative to the current working directory. Generally, there will be no folder_templates
in the current working directory, so the extension falls back tostr(Path(__file__).parent / '_template'
, i.e. the built-in default template. The custom template will not be used, and there will be no warning.Strangely, the tests didn't catch this, even though we explicitly tests that custom templates work. This must be some weird detail of sphinx-testing. 🤷
The text was updated successfully, but these errors were encountered: