Get rid of the workaround for cyrillic in the manual latex builder by not using a cyrillic example

This commit is contained in:
Kovid Goyal 2021-02-28 19:45:58 +05:30
parent d003a61ebe
commit 86b26119f0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 19 deletions

View File

@ -6,8 +6,6 @@ __license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from sphinx.builders.latex import LaTeXBuilder
from sphinx.util.logging import getLogger
from sphinx.writers.latex import LaTeXTranslator
@ -30,14 +28,3 @@ class FixedLaTeXTranslator(LaTeXTranslator):
class LaTeXHelpBuilder(LaTeXBuilder):
name = 'mylatex'
default_translator_class = FixedLaTeXTranslator
def finish(self):
super().finish()
info('Fixing Cyrillic characters...')
tex = os.path.join(self.outdir, 'calibre.tex')
with open(tex, 'r+b') as f:
raw = f.read().decode('utf-8')
for x in (u'Михаил Горбачёв', u'Фёдор Миха́йлович Достоевский'):
raw = raw.replace(x, u'{\\fontencoding{T2A}\\selectfont %s}' % (x.replace(u'а́', u'a')))
f.seek(0)
f.write(raw.encode('utf-8'))

View File

@ -531,15 +531,12 @@ OptionRecommendation(name='asciiize',
recommended_value=False, level=OptionRecommendation.LOW,
help=(_('Transliterate Unicode characters to an ASCII '
'representation. Use with care because this will replace '
'Unicode characters with ASCII. For instance it will replace "%s" '
'with "Mikhail Gorbachiov". Also, note that in '
'Unicode characters with ASCII. For instance it will replace "{0}" '
'with "{1}". Also, note that in '
'cases where there are multiple representations of a character '
'(characters shared by Chinese and Japanese for instance) the '
'representation based on the current calibre interface language will be '
'used.')%
'\u041c\u0438\u0445\u0430\u0438\u043b '
'\u0413\u043e\u0440\u0431\u0430\u0447\u0451\u0432'
)
'used.').format('Pelé', 'Pele'))
),
OptionRecommendation(name='keep_ligatures',