0

我们将 Powerpoint 和 Restructured Text 与 Python-Sphinx 一起使用。我在问自己,是否可以使用 ReST 创建幻灯片。

rst2html5slides我在 https://rst2html5slides.readthedocs.io/en/latest/index.html上找到了有趣的工具。

我安装了这个工具:

pip install rst2html5slides

这没有问题。

现在,我无法使用该工具。rst2html5slides在我的控制台上打字会给出:

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

打字pip list问题:

rst2html5                          1.9.4
rst2html5slides                    1.0

检查我的c:\python27\lib\site-packages\目录后,我发现有一个rst2html5slides_.py,但没有rst2html5slides.py。所以我试图重命名这个文件。

不,我可以开始rst2html5slides --traceback presentation.txt simple_deck.html,但我还有另一个问题。

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 <docutils-users@lists.sf.net>.
Include "--traceback" output, Docutils version (0.12 [release]),
Python version (2.7.10), your OS type & version, and the
command line used.

我在这里做错了什么?

4

1 回答 1

1

rst2html5slides 的作者在这里。不久前我已经更新了软件包。请更新它,它应该运行。

于 2018-11-28T14:10:07.677 回答