sphinx-needs
sphinx-needs copied to clipboard
Node Type Error if need ref is used in Section Title
Using needs 1.2.2
Normally using refs in Sections is possible, e.g refs to other sections with autosectionlabel.
Section1
=======
blabla
Section 2 :ref:`Section1`
=========================
So i tried to use needs refs in my sections,
eg.
.. req:: Longer Text
:id: My_NEED
Some Text
Testing :need:`My_NEED`
=======================
This gives me error during builds:
Extension error (sphinx.environment.collectors.toctree):
Handler <bound method TocTreeCollector.process_doc of <sphinx.environment.collectors.toctree.TocTreeCollector object
at 0x7f820e67b370>> for event 'doctree-read' threw an exception (exception: <class 'sphinx.transforms.SphinxContentsFilter'>
visiting unknown node type: NeedRef)
ninja: build stopped: subcommand failed.
Could this be related to other errors since this 1.0.2 changes or is this NOT supported?
Interesting use case :)
I think the NeedRef-node got not already transformed to standard docutils-nodes, when the TocTreeCollector
gets executed by Sphinx itself.
And it looks like TocTreeCollector
tries to calculate some stuff (title length?) based on known, standard docutils nodes.
I have to take a look into TocTreeCollector
to understand the call-order and move our NeedRef-handling in front of it.
Currently, this happens with the event doctree-resolved
, which I guess is later as TocTreeCollector
gets called.
May be a tough one to solve. So I would say, currently it is not supported, but it should.