rst2epub2
rst2epub2 copied to clipboard
Doesn't work with robot framework user guide
Running rst2epub.py on RobotFrameworkUserGuide.rst fails
To reproduce:
hg clone https://code.google.com/p/robotframework/ cd robotframework/doc/userguide/src echo ".. |version| replace:: trunk" > version.rst rst2epub.py --traceback RobotFrameworkUserGuide.rst
Traceback:
Traceback (most recent call last):
File "/usr/local/bin/rst2epub.py", line 5, in
Still crashes (the project has in meantime moved to https://github.com/robotframework/robotframework.git):
matej@stitny: src (master %)$ rst2epub --traceback -l en RobotFrameworkUserGuide.rst RobotFrameworkUserGuide.epub
RobotFrameworkUserGuide.rst:194: (WARNING/2) Duplicate explicit target name: "post-process outputs".
GettingStarted/INSTALL.rst:511: (ERROR/3) Duplicate target name, cannot be used as a unique reference: "post-process outputs".
ROOT <epublib.epub.TocMapNode instance at 0x7faf3231fe60>
> /home/matej/archiv/knihovna/repos/rst2epub2/epublib/epub.py(308)add_toc_map_node()
-> print("TITLE", title)
(Pdb) bt
/home/matej/.local/bin/rst2epub(11)<module>()
-> load_entry_point('rst2epub2', 'console_scripts', 'rst2epub')()
/home/matej/archiv/knihovna/repos/rst2epub2/rst2epub.py(917)main()
-> enable_exit_status=enable_exit_status,
/usr/lib/python2.7/site-packages/docutils/core.py(219)publish()
-> output = self.writer.write(self.document, self.destination)
/usr/lib/python2.7/site-packages/docutils/writers/__init__.py(80)write()
-> self.translate()
/home/matej/archiv/knihovna/repos/rst2epub2/rst2epub.py(113)translate()
-> self.document.walkabout(visitor)
/usr/lib/python2.7/site-packages/docutils/nodes.py(174)walkabout()
-> if child.walkabout(visitor):
/usr/lib/python2.7/site-packages/docutils/nodes.py(166)walkabout()
-> visitor.dispatch_visit(self)
/home/matej/archiv/knihovna/repos/rst2epub2/rst2epub.py(153)dispatch_visit()
-> html4css1.HTMLTranslator.dispatch_visit(self, node)
/usr/lib/python2.7/site-packages/docutils/nodes.py(1882)dispatch_visit()
-> return method(node)
/home/matej/archiv/knihovna/repos/rst2epub2/rst2epub.py(400)visit_epubcontent()
-> self.create_chapter()
/home/matej/archiv/knihovna/repos/rst2epub2/rst2epub.py(613)create_chapter()
-> item.dest_path, striptags(self.section_title), parent=parent
> /home/matej/archiv/knihovna/repos/rst2epub2/epublib/epub.py(308)add_toc_map_node()
-> print("TITLE", title)
(Pdb)
Check #9, I have had this issue because a title is required before any paragraph. EPUB generation seems less flexible than HTML (in its current implementation by this library).