Open JasperCraeghs opened 1 month ago
I got this error to with the following minimalist doc:
My index.rst
=======
World 1
=======
.. only:: hello
.. only:: foo
Hello foo
=========
Command output:
$ sphinx-build -W -b html -t hello -t foo . _build
Running Sphinx v7.4.7
loading translations [en]... done
making output directory... done
Converting `source_suffix = ['.rst']` to `source_suffix = {'.rst': 'restructuredtext'}`.
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets...
copying static files... done
copying extra files... done
copying assets: done
writing output... [100%] index
Warning, treated as error:
/home/arnaud/dev/sphinx_only/<partial node>::unknown node type: <only: <list_item...>>
Describe the bug
The use of an
only
-directive that is nested inside of a parentonly
-directive to conditionally include a directive of the Sphinx pluginbreathe
fails since Sphinx 7.2. Sphinx<=7.1.2 supports this use case.How to Reproduce
My minimal git repository contains build output of doxygen, needed for the
breathe
directive (doxygenfile
) to function, which is required to reproduce the bug.My
index.rst
:Environment Information
Sphinx extensions
Additional context
The following made me realize that this is likely a bug in
sphinx
and not inbreathe
: https://github.com/sphinx-doc/sphinx/pull/10502I can use directives of other Sphinx plugins in a nested
only
-directive. The crash is specific to the directives of thebreathe
plugin. The version ofdocutils
doesn't seem to matter.