mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '3.x'
This commit is contained in:
commit
9086ecdfff
4
doc/_static/Makefile
vendored
4
doc/_static/Makefile
vendored
@ -1,4 +1,4 @@
|
||||
translation.png: translation.puml
|
||||
plantuml $<
|
||||
translation.svg: translation.puml
|
||||
plantuml -tsvg $<
|
||||
clean:
|
||||
rm translation.png
|
||||
|
BIN
doc/_static/translation.png
vendored
BIN
doc/_static/translation.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 20 KiB |
29
doc/_static/translation.svg
vendored
Normal file
29
doc/_static/translation.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 7.6 KiB |
@ -9,7 +9,7 @@ Complementary to translations provided for Sphinx-generated messages such as
|
||||
navigation bars, Sphinx provides mechanisms facilitating *document* translations
|
||||
in itself. See the :ref:`intl-options` for details on configuration.
|
||||
|
||||
.. figure:: /_static/translation.png
|
||||
.. figure:: /_static/translation.svg
|
||||
:width: 100%
|
||||
|
||||
Workflow visualization of translations in Sphinx. (The figure is created by
|
||||
|
2
setup.py
2
setup.py
@ -44,7 +44,7 @@ extras_require = {
|
||||
'lint': [
|
||||
'flake8>=3.5.0',
|
||||
'flake8-import-order',
|
||||
'mypy>=0.761',
|
||||
'mypy>=0.770',
|
||||
'docutils-stubs',
|
||||
],
|
||||
'test': [
|
||||
|
@ -487,7 +487,7 @@ class Sphinx:
|
||||
other values.
|
||||
"""
|
||||
logger.debug('[app] adding config value: %r',
|
||||
(name, default, rebuild) + ((types,) if types else ())) # type: ignore
|
||||
(name, default, rebuild) + ((types,) if types else ()))
|
||||
if rebuild in (False, True):
|
||||
rebuild = 'env' if rebuild else ''
|
||||
self.config.add(name, default, rebuild, types)
|
||||
|
@ -486,7 +486,7 @@ def patch_settings(settings: Any) -> Any:
|
||||
def validate_config_values(app: Sphinx, config: Config) -> None:
|
||||
for key in list(config.latex_elements):
|
||||
if key not in DEFAULT_SETTINGS:
|
||||
msg = __("Unknown configure key: latex_elements[%r]. ignored.")
|
||||
msg = __("Unknown configure key: latex_elements[%r], ignored.")
|
||||
logger.warning(msg % (key,))
|
||||
config.latex_elements.pop(key)
|
||||
|
||||
|
@ -180,7 +180,7 @@ files can be built by specifying individual filenames.
|
||||
group.add_argument('-W', action='store_true', dest='warningiserror',
|
||||
help=__('turn warnings into errors'))
|
||||
group.add_argument('--keep-going', action='store_true', dest='keep_going',
|
||||
help=__("With -W, keep going when getting warnings"))
|
||||
help=__("with -W, keep going when getting warnings"))
|
||||
group.add_argument('-T', action='store_true', dest='traceback',
|
||||
help=__('show full traceback on exception'))
|
||||
group.add_argument('-P', action='store_true', dest='pdb',
|
||||
|
@ -613,7 +613,7 @@ class Documenter:
|
||||
if skip_user is not None:
|
||||
keep = not skip_user
|
||||
except Exception as exc:
|
||||
logger.warning(__('autodoc: failed to determine %r to be documented.'
|
||||
logger.warning(__('autodoc: failed to determine %r to be documented, '
|
||||
'the following exception was raised:\n%s'),
|
||||
member, exc, type='autodoc')
|
||||
keep = False
|
||||
|
@ -146,7 +146,7 @@ def generate_autosummary_content(name: str, obj: Any, parent: Any,
|
||||
return app.emit_firstresult('autodoc-skip-member', objtype, name,
|
||||
obj, False, {})
|
||||
except Exception as exc:
|
||||
logger.warning(__('autosummary: failed to determine %r to be documented.'
|
||||
logger.warning(__('autosummary: failed to determine %r to be documented, '
|
||||
'the following exception was raised:\n%s'),
|
||||
name, exc, type='autosummary')
|
||||
return False
|
||||
|
@ -38,7 +38,7 @@ class ImagemagickConverter(ImageConverter):
|
||||
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
|
||||
return True
|
||||
except OSError:
|
||||
logger.warning(__('convert command %r cannot be run.'
|
||||
logger.warning(__('convert command %r cannot be run, '
|
||||
'check the image_converter setting'),
|
||||
self.config.image_converter)
|
||||
return False
|
||||
@ -62,7 +62,7 @@ class ImagemagickConverter(ImageConverter):
|
||||
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
|
||||
return True
|
||||
except OSError:
|
||||
logger.warning(__('convert command %r cannot be run.'
|
||||
logger.warning(__('convert command %r cannot be run, '
|
||||
'check the image_converter setting'),
|
||||
self.config.image_converter)
|
||||
return False
|
||||
|
@ -359,7 +359,7 @@ def normalize_intersphinx_mapping(app: Sphinx, config: Config) -> None:
|
||||
else:
|
||||
config.intersphinx_mapping[key] = (name, (uri, inv))
|
||||
except Exception as exc:
|
||||
logger.warning(__('Fail to read intersphinx_mapping[%s], Ignored: %r'), key, exc)
|
||||
logger.warning(__('Failed to read intersphinx_mapping[%s], ignored: %r'), key, exc)
|
||||
config.intersphinx_mapping.pop(key)
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ def get_terminal_width() -> int:
|
||||
import termios
|
||||
import fcntl
|
||||
import struct
|
||||
call = fcntl.ioctl(0, termios.TIOCGWINSZ,
|
||||
call = fcntl.ioctl(0, termios.TIOCGWINSZ, # type: ignore
|
||||
struct.pack('hhhh', 0, 0, 0, 0))
|
||||
height, width = struct.unpack('hhhh', call)[:2]
|
||||
terminal_width = width
|
||||
|
@ -197,7 +197,7 @@ def is_translatable(node: Node) -> bool:
|
||||
if isinstance(node, addnodes.translatable):
|
||||
return True
|
||||
|
||||
if isinstance(node, nodes.Inline) and 'translatable' not in node:
|
||||
if isinstance(node, nodes.Inline) and 'translatable' not in node: # type: ignore
|
||||
# inline node must not be translated if 'translatable' is not set
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user