Open HappyCerberus opened 1 year ago
Thanks for providing a good description fo the issue along with examples.
I don't think we do anything special with the embed:rst
stuff. I can't imagine us reordering things. I guess it might be something do with the nodes that can generated and maybe one node is considered to be an invalid child for another one and so is somehow bumped to the end of it or something.
I'm afraid we don't have the resources to support this project super well at the moment but it is something we can look into when we have time.
I haven't dived fully into the code yet, but I think I know the basics of what is going on here. Notes and Warnings appear as <simplesect kind="note">
and <simplesect kind="warning">
in the Doxygen xml. All simplesects are gathered together in the Breathe parser and then rendered together (likely at the end of the output) in the Breathe renderer. This is what I see in Docutils xml.
This explains the behavior, which I am seeing where all the notes and warnings appear together out of context at the end of the Breathe output:
Time permitting, I'll put together a PR soon.
Sorry, I spoke too soon, not being familiar with how Verbatim works. My case is different as the warnings and notes are generated from Markdown content and rendered into Doxygen XML as noted above. It looks like verbatim XML elements should remain in context. I'll look at both cases as I work through this.
So completely wrong with my guess. The culprit for both problems is sphinxrenderer.py lines 889 and 890:
pullup(candNode, nodes.note, admonitions)
pullup(candNode, nodes.warning, admonitions)
Is there a reason that this would be a good idea, since it appears to be on purpose?
Is there a reason that this would be a good idea, since it appears to be on purpose?
For future reference, I replied in PR https://github.com/breathe-doc/breathe/pull/910#issuecomment-1531640467.
This also happens for inline tables.
:this will: appear out of order like a note
This seems related to #835, but I was focused on the doxygenpage
directive's output. Also, I didn't describe the process to reproduce as well 👍🏼
I'm not 100% sure whether this is an issue with Breathe or Sphinx itself, but:
With the following Restructured text:
Will generate the following output:
The warning block is ordered after the code block. You can also see it in action here: https://simontoth.eu/modern-documentation/other.html