The latest release (0.6.7) of the markdown builder throws an assertion in our project:
[app] emitting event: 'doctree-resolved'(<document: <section "android"...>>, 'devguide/building/android')
[app] emitting event: 'build-finished'(AssertionError(),)
Exception occurred while building, starting debugger:
Traceback (most recent call last):
... (Omitted Sphinx Frames)
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/sphinx_markdown_builder/builder.py", line 91, in write_doc
self.writer.write(doctree, destination)
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/docutils/writers/__init__.py", line 80, in write
self.translate()
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/sphinx_markdown_builder/writer.py", line 51, in translate
self.document.walkabout(visitor)
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/docutils/nodes.py", line 186, in walkabout
if child.walkabout(visitor):
^^^^^^^^^^^^^^^^^^^^^^^^
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/docutils/nodes.py", line 186, in walkabout
if child.walkabout(visitor):
^^^^^^^^^^^^^^^^^^^^^^^^
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/docutils/nodes.py", line 186, in walkabout
if child.walkabout(visitor):
^^^^^^^^^^^^^^^^^^^^^^^^
[Previous line repeated 2 more times]
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/docutils/nodes.py", line 178, in walkabout
visitor.dispatch_visit(self)
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/sphinx/util/docutils.py", line 723, in dispatch_visit
method(node)
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/sphinx_markdown_builder/translator.py", line 761, in visit_label
self.footnote_ctx.visit_label() # workaround pylint: disable=no-member
^^^^^^^^^^^^^^^^^
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/sphinx_markdown_builder/translator.py", line 235, in __getattribute__
return super().__getattribute__(item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../OpenDDS/docs/.venv/lib/python3.12/site-packages/sphinx_markdown_builder/translator.py", line 742, in footnote_ctx
assert isinstance(ctx, FootNoteContext)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
In PDB, I can see what ctx is:
(Pdb) p ctx
<sphinx_markdown_builder.contexts.SubContext object at 0x7df0af2ad8e0>
After some poking around, it looks like it's happening here. These are tabs for selectively showing content like OS-specific instructions. If I take out all the .. tab directives in android.rst, it asserts on next the file with .. tab.
In OpenDDS run ./docs/build.py markdown -d. This is a script I put together to make things easier for my colleagues so they don't have to create a virtual environment, run pip, etc. If you'd rather not run it, I think this should be the bare minimum to do the same thing:
I should add that I'm not sure if sphinx-inline-tabs should be using the label node or not, assuming that's the issue, but other builtin builders like pdf and text don't have this problem.
Describe the bug
The latest release (0.6.7) of the markdown builder throws an assertion in our project:
In PDB, I can see what
ctx
is:After some poking around, it looks like it's happening here. These are tabs for selectively showing content like OS-specific instructions. If I take out all the
.. tab
directives inandroid.rst
, it asserts on next the file with.. tab
.To Reproduce Steps to reproduce the behavior:
docs/requirements.txt
to 0.6.7OpenDDS
run./docs/build.py markdown -d
. This is a script I put together to make things easier for my colleagues so they don't have to create a virtual environment, run pip, etc. If you'd rather not run it, I think this should be the bare minimum to do the same thing:pip install -r docs/requirements.txt
sphinx-build -M markdown docs docs/_build -vv --pdb
Expected behavior
0.6.6 prints warnings like the following and completes:
Environment (please complete the following information):