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
|
translation.svg: translation.puml
|
||||||
plantuml $<
|
plantuml -tsvg $<
|
||||||
clean:
|
clean:
|
||||||
rm translation.png
|
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
|
navigation bars, Sphinx provides mechanisms facilitating *document* translations
|
||||||
in itself. See the :ref:`intl-options` for details on configuration.
|
in itself. See the :ref:`intl-options` for details on configuration.
|
||||||
|
|
||||||
.. figure:: /_static/translation.png
|
.. figure:: /_static/translation.svg
|
||||||
:width: 100%
|
:width: 100%
|
||||||
|
|
||||||
Workflow visualization of translations in Sphinx. (The figure is created by
|
Workflow visualization of translations in Sphinx. (The figure is created by
|
||||||
|
2
setup.py
2
setup.py
@ -44,7 +44,7 @@ extras_require = {
|
|||||||
'lint': [
|
'lint': [
|
||||||
'flake8>=3.5.0',
|
'flake8>=3.5.0',
|
||||||
'flake8-import-order',
|
'flake8-import-order',
|
||||||
'mypy>=0.761',
|
'mypy>=0.770',
|
||||||
'docutils-stubs',
|
'docutils-stubs',
|
||||||
],
|
],
|
||||||
'test': [
|
'test': [
|
||||||
|
@ -487,7 +487,7 @@ class Sphinx:
|
|||||||
other values.
|
other values.
|
||||||
"""
|
"""
|
||||||
logger.debug('[app] adding config value: %r',
|
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):
|
if rebuild in (False, True):
|
||||||
rebuild = 'env' if rebuild else ''
|
rebuild = 'env' if rebuild else ''
|
||||||
self.config.add(name, default, rebuild, types)
|
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:
|
def validate_config_values(app: Sphinx, config: Config) -> None:
|
||||||
for key in list(config.latex_elements):
|
for key in list(config.latex_elements):
|
||||||
if key not in DEFAULT_SETTINGS:
|
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,))
|
logger.warning(msg % (key,))
|
||||||
config.latex_elements.pop(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',
|
group.add_argument('-W', action='store_true', dest='warningiserror',
|
||||||
help=__('turn warnings into errors'))
|
help=__('turn warnings into errors'))
|
||||||
group.add_argument('--keep-going', action='store_true', dest='keep_going',
|
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',
|
group.add_argument('-T', action='store_true', dest='traceback',
|
||||||
help=__('show full traceback on exception'))
|
help=__('show full traceback on exception'))
|
||||||
group.add_argument('-P', action='store_true', dest='pdb',
|
group.add_argument('-P', action='store_true', dest='pdb',
|
||||||
|
@ -613,7 +613,7 @@ class Documenter:
|
|||||||
if skip_user is not None:
|
if skip_user is not None:
|
||||||
keep = not skip_user
|
keep = not skip_user
|
||||||
except Exception as exc:
|
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'),
|
'the following exception was raised:\n%s'),
|
||||||
member, exc, type='autodoc')
|
member, exc, type='autodoc')
|
||||||
keep = False
|
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,
|
return app.emit_firstresult('autodoc-skip-member', objtype, name,
|
||||||
obj, False, {})
|
obj, False, {})
|
||||||
except Exception as exc:
|
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'),
|
'the following exception was raised:\n%s'),
|
||||||
name, exc, type='autosummary')
|
name, exc, type='autosummary')
|
||||||
return False
|
return False
|
||||||
|
@ -38,7 +38,7 @@ class ImagemagickConverter(ImageConverter):
|
|||||||
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
|
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
|
||||||
return True
|
return True
|
||||||
except OSError:
|
except OSError:
|
||||||
logger.warning(__('convert command %r cannot be run.'
|
logger.warning(__('convert command %r cannot be run, '
|
||||||
'check the image_converter setting'),
|
'check the image_converter setting'),
|
||||||
self.config.image_converter)
|
self.config.image_converter)
|
||||||
return False
|
return False
|
||||||
@ -62,7 +62,7 @@ class ImagemagickConverter(ImageConverter):
|
|||||||
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
|
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
|
||||||
return True
|
return True
|
||||||
except OSError:
|
except OSError:
|
||||||
logger.warning(__('convert command %r cannot be run.'
|
logger.warning(__('convert command %r cannot be run, '
|
||||||
'check the image_converter setting'),
|
'check the image_converter setting'),
|
||||||
self.config.image_converter)
|
self.config.image_converter)
|
||||||
return False
|
return False
|
||||||
|
@ -359,7 +359,7 @@ def normalize_intersphinx_mapping(app: Sphinx, config: Config) -> None:
|
|||||||
else:
|
else:
|
||||||
config.intersphinx_mapping[key] = (name, (uri, inv))
|
config.intersphinx_mapping[key] = (name, (uri, inv))
|
||||||
except Exception as exc:
|
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)
|
config.intersphinx_mapping.pop(key)
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ def get_terminal_width() -> int:
|
|||||||
import termios
|
import termios
|
||||||
import fcntl
|
import fcntl
|
||||||
import struct
|
import struct
|
||||||
call = fcntl.ioctl(0, termios.TIOCGWINSZ,
|
call = fcntl.ioctl(0, termios.TIOCGWINSZ, # type: ignore
|
||||||
struct.pack('hhhh', 0, 0, 0, 0))
|
struct.pack('hhhh', 0, 0, 0, 0))
|
||||||
height, width = struct.unpack('hhhh', call)[:2]
|
height, width = struct.unpack('hhhh', call)[:2]
|
||||||
terminal_width = width
|
terminal_width = width
|
||||||
|
@ -197,7 +197,7 @@ def is_translatable(node: Node) -> bool:
|
|||||||
if isinstance(node, addnodes.translatable):
|
if isinstance(node, addnodes.translatable):
|
||||||
return True
|
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
|
# inline node must not be translated if 'translatable' is not set
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user