Search code examples
htmlrestructuredtextdocutilsimpress.jsrst2html.py

Unable to start rst2html5slides after installation


We are using Powerpoint and Restructured Text together with Python-Sphinx. I was asking myself, if it is possible to create slides using ReST.

I found the interesting Tool rst2html5slides on https://rst2html5slides.readthedocs.io/en/latest/index.html.

I installed the tool with:

pip install rst2html5slides

This worked without problems.

Now, I was unable to use the tool. Typing rst2html5slides on my console gives:

Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\rst2html5slides.exe\__main__.py", line 5, in <module>
  File "c:\python27\lib\site-packages\rst2html5slides.py", line 16, in <module>
    from rst2html5 import HTML5Translator, HTML5Writer
ImportError: No module named rst2html5

Typing pip list issues:

rst2html5                          1.9.4
rst2html5slides                    1.0

After inspecting my c:\python27\lib\site-packages\ directory I found out, that there is an rst2html5slides_.py, but no rst2html5slides.py. So I tried to just rename this file.

No it was possible for me to start rst2html5slides --traceback presentation.txt simple_deck.html, but I just have another problem.

Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\rst2html5slides.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\rst2html5slides.py", line 484, in main
    publish_cmdline(writer=SlideWriter(), description=description)
  File "c:\python27\lib\site-packages\docutils\core.py", line 352, in publish_cmdline
    config_section=config_section, enable_exit_status=enable_exit_status)
  File "c:\python27\lib\site-packages\docutils\core.py", line 219, in publish
    output = self.writer.write(self.document, self.destination)
  File "c:\python27\lib\site-packages\docutils\writers\__init__.py", line 80, in write
    self.translate()
  File "c:\python27\lib\site-packages\rst2html5slides.py", line 200, in translate
    HTML5Writer.translate(self)
  File "c:\python27\lib\site-packages\rst2html5.py", line 227, in translate
    self.document.walkabout(visitor)
  File "c:\python27\lib\site-packages\docutils\nodes.py", line 187, in walkabout
    visitor.dispatch_departure(self)
  File "c:\python27\lib\site-packages\docutils\nodes.py", line 1895, in dispatch_departure
    return method(node)
  File "c:\python27\lib\site-packages\rst2html5slides.py", line 294, in depart_document
    self._ordered_tag_attributes(deck,
AttributeError: SlideTranslator instance has no attribute '_ordered_tag_attributes'
AttributeError: SlideTranslator instance has no attribute '_ordered_tag_attributes'
Exiting due to error.  Use "--traceback" to diagnose.
Please report errors to <[email protected]>.
Include "--traceback" output, Docutils version (0.12 [release]),
Python version (2.7.10), your OS type & version, and the
command line used.

What I'm doing wrong here?


Solution

  • rst2html5slides' author here. I've updated the package a while ago. Please, update it and it should run.