brechtm / rinohtype

The Python document processor
http://www.mos6581.org/rinohtype
GNU Affero General Public License v3.0
500 stars 60 forks source link

Another: NotImplementedError: None:None the 'desc_sig_space' node is not yet supported (rinoh.frontend.sphinx.nodes) #418

Open BobDenny opened 1 year ago

BobDenny commented 1 year ago

Is there an existing issue for this?

Possibly- https://github.com/brechtm/rinohtype/issues/414

Sphinx or rinoh output

File "/home/pi/Documents/ASCOM-Master-Docs-2022/.venv/lib/python3.9/site-packages/rinoh/frontend/__init__.py", line 30, in map_node
    raise NotImplementedError("{}:{} the '{}' node is not yet supported "
NotImplementedError: None:None the 'desc_sig_space' node is not yet supported (rinoh.frontend.sphinx.nodes)

Source files

https://github.com/BobDenny/ASCOM-Master-Docs-2022

Noting here is private. I invoke as make rinoh. Ignore the two requirements.txt files Iam not a high-end developer or Linux expert

Versions

(.venv) pi@rpi1:~/Documents/ASCOM-Master-Docs-2022 $ rinoh --versions
rinohtype 0.5.4 (2022-06-17)
Sphinx 7.2.4
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110]
Linux-6.1.21-v8+-aarch64-with-glibc2.31
BobDenny commented 1 year ago

I can't figure out how to find the flaw in my RST that is causing this. I'm not an expert. I don't know how to re-open a GitHub issue. I'm just a lowly documentation writer. What is a desc_sig_space node and wht ReStructuredText constructs can result in that? My docs build perfectly with no lint warnings, esbonio previews are perfect, ??? I'm stuck. I have been able to build with rinohtype in the past. This "just started happening" but of course I am editing my content :-) sphinx-err-5etbarpp.log

BobDenny commented 1 year ago

Oh I am sorry.. I did try the addition to conf.py from #414

from rinoh.frontend.rst import DocutilsInlineNode

class Desc_Sig_Space(DocutilsInlineNode):
    pass

and it is working. My concern is that there may be an error in the PDF that was hidden by this.

brechtm commented 1 year ago

This fix is now included in the development version. It is still not clear to me what is causing this, so it would be helpful if you can provide a (preferably minimal) Sphinx project that suffers from this issue.

This shouldn't cause any errors in the PDF. At worst, some content might be missing from the PDF. That should be easy to check with a minimal project. Have you noticed anything missing?

brechtm commented 1 year ago

BTW To figure out which content is causing an issue such as this, you can repeatedly remove (e.g. remove entries from toctree directives) parts of your document. When the document completes rendering, you know that the problematic content is part of what you removed. In a couple of steps, you can build this "minimal project" I mentioned above.

BobDenny commented 1 year ago

OK, thank you! I have been diverted from this project for some time maybe weeks. I'll try to run these tests as soon as I can. Thank you for providing a way to get the PDF out!! While people review it maybe they will find out what's missing ha ha.

BobDenny commented 11 months ago

Another

        raise AttributeError('No such element: {} in {}'.format(name, self))
    AttributeError: No such element: styled_text in <rinoh.frontend.rst.nodes.Definition_List object at 0x0000029E4BBE2710>

The previous bypass doesn't work for this. I made the virtually same changes in 10 RST files. No errors from Sphinx HTML build nor from Esbonio, and the HTML render from these is perfect. I've created a branch freezing the successful RST and will try to narrow this down. If you happen to have another bypass for this similar to that in #414 that would be cool. For now I'm OK with some missing bits. Thanks again for this great tool!!!

brechtm commented 11 months ago

I may be wrong, but this feels like an invalid Sphinx document tree. Unfortunately, Sphinx (or docutils) doesn't check whether a document tree is valid or not. A _definitionlist is a body-type element (versus inline), so the _styledtext method should not be called on it.

This exception will occur if the _definitionlist element is included in another element as an inline element. Possibly a Sphinx plugin is to blame for this. I'll need a (preferably minimal) project to reproduce this. Since you seem to know which change triggered this issue, this should hopefully be fairly easy.

BobDenny commented 11 months ago

Thank you so much. I was able to find this by setting a branch and incrementally replacing. One document had this. In the rendered HTML it was messy. My fault, but the gigantic error log (attached) was no help ha ha ha. I'm no wizard programmer. Adding a space before :raises DriverException: eliminated the problem.

Snap1

Oct 15 Rinoh Error.log

brechtm commented 11 months ago

Thank you for the donation, and great to hear that you were able to find the cause for this problem!

This is indeed one of the major pitfalls of reStructuredText. This hard-to-spot indentation mistake results in an invalid document tree, yet Sphinx happily continues and the HTML backend renders it anyway. I have run into subtle hard to debug issues caused by indentation mistakes multiple times myself.

If you feel up to it, please report this usability issue with the Sphinx project.