mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make building manual more reliable
This commit is contained in:
parent
e5ee211dd1
commit
a2bf48c929
@ -355,8 +355,24 @@ def setup_man_pages(app):
|
||||
app.config['man_pages'] = man_pages
|
||||
|
||||
|
||||
def monkey_patch_docutils():
|
||||
# fixes a bug in sphinx https://github.com/sphinx-doc/sphinx/issues/5150
|
||||
from docutils import nodes
|
||||
|
||||
orig_method = nodes.document.set_duplicate_name_id
|
||||
|
||||
def set_duplicate_name_id(*a):
|
||||
try:
|
||||
return orig_method(*a)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
nodes.document.set_duplicate_name_id = set_duplicate_name_id
|
||||
|
||||
|
||||
def setup(app):
|
||||
from docutils.parsers.rst import roles
|
||||
monkey_patch_docutils()
|
||||
setup_man_pages(app)
|
||||
app.add_builder(EPUBHelpBuilder)
|
||||
app.add_builder(LaTeXHelpBuilder)
|
||||
|
@ -21,8 +21,13 @@ from polyglot.builtins import iteritems
|
||||
class EPUBHelpBuilder(EpubBuilder):
|
||||
name = 'myepub'
|
||||
|
||||
def build_epub(self, outdir, outname):
|
||||
def build_epub(self, outdir=None, outname=None):
|
||||
if outdir:
|
||||
EpubBuilder.build_epub(self, outdir, outname)
|
||||
else:
|
||||
EpubBuilder.build_epub(self)
|
||||
outdir = self.outdir
|
||||
outname = self.config.epub_basename + '.epub'
|
||||
container = get_container(os.path.join(outdir, outname))
|
||||
self.fix_epub(container)
|
||||
container.commit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user