mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-13 00:42:11 -05:00
Unescape quotation marks where possible
This commit is contained in:
1 parent
13442f6901
commit
6c56988979
15 files changed
+19
-19
No files matched your search
@@ -941,7 +941,7 @@ class StandaloneHTMLBuilder(Builder):
|
||||
self.indexer.load(fb, self.indexer_format)
|
||||
except (OSError, ValueError):
|
||||
if keep:
|
||||
logger.warning(__('search index couldn\'t be loaded, but not all '
|
||||
logger.warning(__("search index couldn't be loaded, but not all "
|
||||
'documents will be built: the index will be '
|
||||
'incomplete.'))
|
||||
# delete all entries for files that will be rebuilt
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ files can be built by specifying individual filenames.
|
||||
help=__('write all files (default: only write new and '
|
||||
'changed files)'))
|
||||
group.add_argument('-E', action='store_true', dest='freshenv',
|
||||
help=__('don\'t use a saved environment, always read '
|
||||
help=__("don't use a saved environment, always read "
|
||||
'all files'))
|
||||
group.add_argument('-d', metavar='PATH', dest='doctreedir',
|
||||
help=__('path for the cached environment and doctree '
|
||||
|
||||
@@ -255,7 +255,7 @@ def ask_user(d: dict[str, Any]) -> None:
|
||||
print(__('Sphinx has the notion of a "version" and a "release" for the\n'
|
||||
'software. Each version can have multiple releases. For example, for\n'
|
||||
'Python the version is something like 2.5 or 3.0, while the release is\n'
|
||||
'something like 2.5.1 or 3.0a1. If you don\'t need this dual structure,\n'
|
||||
"something like 2.5.1 or 3.0a1. If you don't need this dual structure,\n"
|
||||
'just set both to the same value.'))
|
||||
d['version'] = do_prompt(__('Project version'), '', allow_empty)
|
||||
if 'release' not in d:
|
||||
@@ -315,7 +315,7 @@ def ask_user(d: dict[str, Any]) -> None:
|
||||
if 'makefile' not in d:
|
||||
print()
|
||||
print(__('A Makefile and a Windows command file can be generated for you so that you\n'
|
||||
'only have to run e.g. `make html\' instead of invoking sphinx-build\n'
|
||||
"only have to run e.g. `make html' instead of invoking sphinx-build\n"
|
||||
'directly.'))
|
||||
d['makefile'] = do_prompt(__('Create Makefile? (y/n)'), 'y', boolean)
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class TocTree(SphinxDirective):
|
||||
toctree['entries'].append((None, docname))
|
||||
toctree['includefiles'].append(docname)
|
||||
if not docnames:
|
||||
logger.warning(__('toctree glob pattern %r didn\'t match any documents'),
|
||||
logger.warning(__("toctree glob pattern %r didn't match any documents"),
|
||||
entry, location=toctree)
|
||||
else:
|
||||
if explicit:
|
||||
|
||||
@@ -721,7 +721,7 @@ class BuildEnvironment:
|
||||
continue
|
||||
if 'orphan' in self.metadata[docname]:
|
||||
continue
|
||||
logger.warning(__('document isn\'t included in any toctree'),
|
||||
logger.warning(__("document isn't included in any toctree"),
|
||||
location=docname)
|
||||
|
||||
# call check-consistency for all extensions
|
||||
|
||||
@@ -175,7 +175,7 @@ class TocTree:
|
||||
if not toc.children:
|
||||
# empty toc means: no titles will show up in the toctree
|
||||
logger.warning(__('toctree contains reference to document %r that '
|
||||
'doesn\'t have a title: no link will be generated'),
|
||||
"doesn't have a title: no link will be generated"),
|
||||
ref, location=toctreenode)
|
||||
except KeyError:
|
||||
# this is raised if the included file does not exist
|
||||
|
||||
@@ -869,7 +869,7 @@ class Documenter:
|
||||
if not self.parse_name():
|
||||
# need a module to import
|
||||
logger.warning(
|
||||
__('don\'t know which module to import for autodocumenting '
|
||||
__("don't know which module to import for autodocumenting "
|
||||
'%r (try placing a "module" or "currentmodule" directive '
|
||||
'in the document, or giving an explicit module name)') %
|
||||
self.name, type='autodoc')
|
||||
|
||||
@@ -44,7 +44,7 @@ def _get_full_modname(app: Sphinx, modname: str, attribute: str) -> str | None:
|
||||
except AttributeError:
|
||||
# sphinx.ext.viewcode can't follow class instance attribute
|
||||
# then AttributeError logging output only verbose mode.
|
||||
logger.verbose('Didn\'t find %s in %s', attribute, modname)
|
||||
logger.verbose("Didn't find %s in %s", attribute, modname)
|
||||
return None
|
||||
except Exception as e:
|
||||
# sphinx.ext.viewcode follow python domain directives.
|
||||
|
||||
@@ -74,7 +74,7 @@ class BuildDoc(Command):
|
||||
('builder=', 'b', 'The builder (or builders) to use. Can be a comma- '
|
||||
'or space-separated list. Defaults to "html"'),
|
||||
('warning-is-error', 'W', 'Turn warning into errors'),
|
||||
('project=', None, 'The documented project\'s name'),
|
||||
('project=', None, "The documented project's name"),
|
||||
('version=', None, 'The short X.Y version'),
|
||||
('release=', None, 'The full version, including alpha/beta/rc tags'),
|
||||
('today=', None, 'How to format the current date, used as the '
|
||||
|
||||
@@ -151,7 +151,7 @@ class ReferencesResolver(SphinxPostTransform):
|
||||
reftitle = node.get('reftitle', node.astext())
|
||||
return f':{name}:`{reftitle}`'
|
||||
candidates = ' or '.join(stringify(name, role) for name, role in results)
|
||||
logger.warning(__('more than one target found for \'any\' cross-'
|
||||
logger.warning(__("more than one target found for 'any' cross-"
|
||||
'reference %r: could be %s'), target, candidates,
|
||||
location=node)
|
||||
res_role, newnode = results[0]
|
||||
|
||||
@@ -118,7 +118,7 @@ def test_html_warnings(app, warning):
|
||||
html_warnings_exp = HTML_WARNINGS % {
|
||||
'root': re.escape(app.srcdir.replace(os.sep, '/'))}
|
||||
assert re.match(html_warnings_exp + '$', html_warnings), \
|
||||
'Warnings don\'t match:\n' + \
|
||||
"Warnings don't match:\n" + \
|
||||
'--- Expected (regex):\n' + html_warnings_exp + \
|
||||
'--- Got:\n' + html_warnings
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ def test_latex_warnings(app, status, warning):
|
||||
warnings_exp = LATEX_WARNINGS % {
|
||||
'root': re.escape(app.srcdir.replace(os.sep, '/'))}
|
||||
assert re.match(warnings_exp + '$', warnings), \
|
||||
'Warnings don\'t match:\n' + \
|
||||
"Warnings don't match:\n" + \
|
||||
'--- Expected (regex):\n' + warnings_exp + \
|
||||
'--- Got:\n' + warnings
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def test_texinfo_warnings(app, status, warning):
|
||||
warnings_exp = TEXINFO_WARNINGS % {
|
||||
'root': re.escape(app.srcdir.replace(os.sep, '/'))}
|
||||
assert re.match(warnings_exp + '$', warnings), \
|
||||
'Warnings don\'t match:\n' + \
|
||||
"Warnings don't match:\n" + \
|
||||
'--- Expected (regex):\n' + warnings_exp + \
|
||||
'--- Got:\n' + warnings
|
||||
|
||||
|
||||
@@ -223,13 +223,13 @@ def test_format_signature(app):
|
||||
directive.env.config.autoclass_content = 'both'
|
||||
|
||||
class F2:
|
||||
'''some docstring for F2.'''
|
||||
"""some docstring for F2."""
|
||||
def __init__(self, *args, **kw):
|
||||
'''
|
||||
"""
|
||||
__init__(a1, a2, kw1=True, kw2=False)
|
||||
|
||||
some docstring for __init__.
|
||||
'''
|
||||
"""
|
||||
class G2(F2):
|
||||
pass
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ def test_quickstart_all_answers(tempdir):
|
||||
'Separate source and build': 'y',
|
||||
'Name prefix for templates': '.',
|
||||
'Project name': 'STASI™',
|
||||
'Author name': 'Wolfgang Schäuble & G\'Beckstein',
|
||||
'Author name': "Wolfgang Schäuble & G'Beckstein",
|
||||
'Project version': '2.0',
|
||||
'Project release': '2.0.1',
|
||||
'Project language': 'de',
|
||||
@@ -158,7 +158,7 @@ def test_quickstart_all_answers(tempdir):
|
||||
assert ns['source_suffix'] == '.txt'
|
||||
assert ns['root_doc'] == 'contents'
|
||||
assert ns['project'] == 'STASI™'
|
||||
assert ns['copyright'] == '%s, Wolfgang Schäuble & G\'Beckstein' % \
|
||||
assert ns['copyright'] == "%s, Wolfgang Schäuble & G'Beckstein" % \
|
||||
time.strftime('%Y')
|
||||
assert ns['version'] == '2.0'
|
||||
assert ns['release'] == '2.0.1'
|
||||
|
||||
Reference in new issue
Block a user