brechtm / rinohtype

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

KeyError: 'desc_sig_space' #414

Closed nicorenard closed 1 year ago

nicorenard commented 1 year ago

Is there an existing issue for this?

Sphinx or rinoh output

Hello, can you help me with this problem when using rinoh ?
I'm using the sphinx command : 'make rinoh' with the sphhinx build module
here is the last line of the log file : 

Traceback (most recent call last):
  File "c:\users\nrenard\pycharmproject\pythonproject\visiopompe2\venv\lib\site-packages\rinoh\frontend\__init__.py", line 27, in map_node
    return cls._mapping[node_name.replace('-', '_')](node, **context)
KeyError: 'desc_sig_space'

During handling of the above exception, another exception occurred:
 File "c:\users\nrenard\pycharmproject\pythonproject\visiopompe2\venv\lib\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)

The complete report is given. 
Thanks for the help.

Regards,
Nico

Source files

sphinx-err-77tc5nzx.log

Versions

rinohtype 0.5.4 (2022-06-17)
Sphinx 6.2.1
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)]
Windows-10-10.0.19045-SP0
brechtm commented 1 year ago

This might be trivial to fix, but I'll need to reproduce this in order to fix it. Please provide a minimal Sphinx project that triggers this bug. The unsupported node will very likely originate from a domain directive.

brechtm commented 1 year ago

I haven't been able to reproduce the issue; _desc_sigspace seem to be converted to a regular inline text node before they reach rinohtype in my tests.

Try to add the following to the top of your conf.py to see whether this fixes it:

from rinoh.frontend.rst import DocutilsInlineNode

class Desc_Sig_Space(DocutilsInlineNode):
    pass

A minimal project that triggers the issue would still be helpful.

nicorenard commented 1 year ago

Hello,

Thank you for your time. It's working now. everything is perfect. thanks ! :) Also, i'm using django and just to know , in the conf.py , if I take off this code line :

import django
os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings'
django.setup()

rinoh work whithout you code but not the html version who become empty with theme used ( sphinx_rtd_theme for example). But that's another issue :)

I will try to give you a minimal project as quick I can. in a next reply. conf.zip

Thanks again for you time.