我们将Powerpoint和重组文本与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.
我在这里做错了什么?
答案 0 :(得分:1)
rst2html5slides的作者在这里。我刚刚更新了软件包。请对其进行更新,它应该可以运行。