mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sadly the better fix did not work
so go back to mokeypatching
This commit is contained in:
parent
406838dc7d
commit
d003a61ebe
@ -10,17 +10,29 @@ import os
|
|||||||
|
|
||||||
from sphinx.builders.latex import LaTeXBuilder
|
from sphinx.builders.latex import LaTeXBuilder
|
||||||
from sphinx.util.logging import getLogger
|
from sphinx.util.logging import getLogger
|
||||||
|
from sphinx.writers.latex import LaTeXTranslator
|
||||||
|
|
||||||
|
|
||||||
def info(*a):
|
def info(*a):
|
||||||
getLogger(__name__).info(*a)
|
getLogger(__name__).info(*a)
|
||||||
|
|
||||||
|
|
||||||
|
class FixedLaTeXTranslator(LaTeXTranslator):
|
||||||
|
# see https://github.com/sphinx-doc/sphinx/issues/8936
|
||||||
|
|
||||||
|
def visit_substitution_definition(self, node):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def depart_substitution_definition(self, node):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class LaTeXHelpBuilder(LaTeXBuilder):
|
class LaTeXHelpBuilder(LaTeXBuilder):
|
||||||
name = 'mylatex'
|
name = 'mylatex'
|
||||||
|
default_translator_class = FixedLaTeXTranslator
|
||||||
|
|
||||||
def finish(self):
|
def finish(self):
|
||||||
LaTeXBuilder.finish(self)
|
super().finish()
|
||||||
info('Fixing Cyrillic characters...')
|
info('Fixing Cyrillic characters...')
|
||||||
tex = os.path.join(self.outdir, 'calibre.tex')
|
tex = os.path.join(self.outdir, 'calibre.tex')
|
||||||
with open(tex, 'r+b') as f:
|
with open(tex, 'r+b') as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user