mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '5.0.x' into 5.x
This commit is contained in:
commit
4a9d80b008
6
CHANGES
6
CHANGES
@ -37,6 +37,12 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #10498: gettext: TypeError is raised when sorting warning messages if a node
|
||||||
|
has no line number
|
||||||
|
* #10493: html theme: :rst:dir:`topic` directive is rendered incorrectly with
|
||||||
|
docutils-0.18
|
||||||
|
* #10495: IndexError is raised for a :rst:role:`kbd` role having a separator
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -53,7 +53,10 @@ class Catalog:
|
|||||||
if msg not in self.metadata: # faster lookup in hash
|
if msg not in self.metadata: # faster lookup in hash
|
||||||
self.messages.append(msg)
|
self.messages.append(msg)
|
||||||
self.metadata[msg] = []
|
self.metadata[msg] = []
|
||||||
self.metadata[msg].append((origin.source, origin.line, origin.uid)) # type: ignore
|
line = origin.line
|
||||||
|
if line is None:
|
||||||
|
line = -1
|
||||||
|
self.metadata[msg].append((origin.source, line, origin.uid)) # type: ignore
|
||||||
|
|
||||||
def __iter__(self) -> Generator[Message, None, None]:
|
def __iter__(self) -> Generator[Message, None, None]:
|
||||||
for message in self.messages:
|
for message in self.messages:
|
||||||
|
@ -40,7 +40,9 @@ class KeyboardTransform(SphinxPostTransform):
|
|||||||
|
|
||||||
def run(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
matcher = NodeMatcher(nodes.literal, classes=["kbd"])
|
matcher = NodeMatcher(nodes.literal, classes=["kbd"])
|
||||||
for node in self.document.findall(matcher): # type: nodes.literal
|
# this list must be pre-created as during iteration new nodes
|
||||||
|
# are added which match the condition in the NodeMatcher.
|
||||||
|
for node in list(self.document.findall(matcher)): # type: nodes.literal
|
||||||
parts = self.pattern.split(node[-1].astext())
|
parts = self.pattern.split(node[-1].astext())
|
||||||
if len(parts) == 1 or self.is_multiwords_key(parts):
|
if len(parts) == 1 or self.is_multiwords_key(parts):
|
||||||
continue
|
continue
|
||||||
|
@ -51,7 +51,7 @@ def process_ifconfig_nodes(app: Sphinx, doctree: nodes.document, docname: str) -
|
|||||||
ns = {confval.name: confval.value for confval in app.config}
|
ns = {confval.name: confval.value for confval in app.config}
|
||||||
ns.update(app.config.__dict__.copy())
|
ns.update(app.config.__dict__.copy())
|
||||||
ns['builder'] = app.builder.name
|
ns['builder'] = app.builder.name
|
||||||
for node in doctree.findall(ifconfig):
|
for node in list(doctree.findall(ifconfig)):
|
||||||
try:
|
try:
|
||||||
res = eval(node['expr'], ns)
|
res = eval(node['expr'], ns)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
@ -271,7 +271,8 @@ div.document ol {
|
|||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
|
|
||||||
div.sidebar {
|
div.sidebar,
|
||||||
|
aside.sidebar {
|
||||||
width: {{ theme_sidebarwidth|todim }};
|
width: {{ theme_sidebarwidth|todim }};
|
||||||
{%- if theme_rightsidebar|tobool %}
|
{%- if theme_rightsidebar|tobool %}
|
||||||
float: right;
|
float: right;
|
||||||
@ -281,26 +282,29 @@ div.sidebar {
|
|||||||
font-size: .9em;
|
font-size: .9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar a, div.header a {
|
div.sidebar a, aside.sidebar a, div.header a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar a:hover, div.header a:hover {
|
div.sidebar a:hover, aside.sidebar a:hover, div.header a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar h3 {
|
div.sidebar h3,
|
||||||
|
aside.sidebar h3 {
|
||||||
color: #2e3436;
|
color: #2e3436;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-size: 130%;
|
font-size: 130%;
|
||||||
letter-spacing: .1em;
|
letter-spacing: .1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar ul {
|
div.sidebar ul,
|
||||||
|
aside.sidebar ul {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar li.toctree-l1 a {
|
div.sidebar li.toctree-l1 a,
|
||||||
|
aside.sidebar li.toctree-l1 a {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
border: 1px solid #dddddd;
|
border: 1px solid #dddddd;
|
||||||
@ -310,37 +314,44 @@ div.sidebar li.toctree-l1 a {
|
|||||||
color: #2e3436;
|
color: #2e3436;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar li.toctree-l2 a {
|
div.sidebar li.toctree-l2 a,
|
||||||
|
aside.sidebar li.toctree-l2 a {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
border-bottom: 1px solid #dddddd;
|
border-bottom: 1px solid #dddddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar li.toctree-l3 a {
|
div.sidebar li.toctree-l3 a,
|
||||||
|
aside.sidebar li.toctree-l3 a {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
margin-left: 2em;
|
margin-left: 2em;
|
||||||
border-bottom: 1px solid #dddddd;
|
border-bottom: 1px solid #dddddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar li.toctree-l2:last-child a {
|
div.sidebar li.toctree-l2:last-child a,
|
||||||
|
aside.sidebar li.toctree-l2:last-child a {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar li.toctree-l1.current a {
|
div.sidebar li.toctree-l1.current a,
|
||||||
|
aside.sidebar li.toctree-l1.current a {
|
||||||
border-right: 5px solid {{ theme_headerlinkcolor }};
|
border-right: 5px solid {{ theme_headerlinkcolor }};
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar li.toctree-l1.current li.toctree-l2 a {
|
div.sidebar li.toctree-l1.current li.toctree-l2 a,
|
||||||
|
aside.sidebar li.toctree-l1.current li.toctree-l2 a {
|
||||||
border-right: none;
|
border-right: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar input[type="text"] {
|
div.sidebar input[type="text"],
|
||||||
|
aside.sidebar input[type="text"] {
|
||||||
width: 170px;
|
width: 170px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.sidebar input[type="submit"] {
|
div.sidebar input[type="submit"],
|
||||||
|
aside.sidebar input[type="submit"] {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,13 +335,13 @@ p.sidebar-title {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.admonition, div.topic, blockquote {
|
div.admonition, div.topic, aside.topic, blockquote {
|
||||||
clear: left;
|
clear: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -- topics ---------------------------------------------------------------- */
|
/* -- topics ---------------------------------------------------------------- */
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
margin: 10px 0 10px 0;
|
margin: 10px 0 10px 0;
|
||||||
@ -380,6 +380,7 @@ div.body p.centered {
|
|||||||
div.sidebar > :last-child,
|
div.sidebar > :last-child,
|
||||||
aside.sidebar > :last-child,
|
aside.sidebar > :last-child,
|
||||||
div.topic > :last-child,
|
div.topic > :last-child,
|
||||||
|
aside.topic > :last-child,
|
||||||
div.admonition > :last-child {
|
div.admonition > :last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
@ -387,6 +388,7 @@ div.admonition > :last-child {
|
|||||||
div.sidebar::after,
|
div.sidebar::after,
|
||||||
aside.sidebar::after,
|
aside.sidebar::after,
|
||||||
div.topic::after,
|
div.topic::after,
|
||||||
|
aside.topic::after,
|
||||||
div.admonition::after,
|
div.admonition::after,
|
||||||
blockquote::after {
|
blockquote::after {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -306,7 +306,7 @@ div.quotebar {
|
|||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ div.seealso {
|
|||||||
border: 1px solid #ff6;
|
border: 1px solid #ff6;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ p.rubric {
|
|||||||
|
|
||||||
/* -- sidebars -------------------------------------------------------------- */
|
/* -- sidebars -------------------------------------------------------------- */
|
||||||
|
|
||||||
div.sidebar {
|
div.sidebar, aside.sidebar {
|
||||||
margin: 0 0 0.5em 1em;
|
margin: 0 0 0.5em 1em;
|
||||||
border: 1px solid #ddb;
|
border: 1px solid #ddb;
|
||||||
padding: 7px 7px 0 7px;
|
padding: 7px 7px 0 7px;
|
||||||
@ -245,7 +245,7 @@ p.sidebar-title {
|
|||||||
|
|
||||||
/* -- topics ---------------------------------------------------------------- */
|
/* -- topics ---------------------------------------------------------------- */
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
padding: 7px 7px 0 7px;
|
padding: 7px 7px 0 7px;
|
||||||
margin: 10px 0 10px 0;
|
margin: 10px 0 10px 0;
|
||||||
|
@ -194,7 +194,7 @@ div.seealso {
|
|||||||
border: 1px solid #ff6;
|
border: 1px solid #ff6;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ p.rubric {
|
|||||||
|
|
||||||
/* -- sidebars -------------------------------------------------------------- */
|
/* -- sidebars -------------------------------------------------------------- */
|
||||||
|
|
||||||
div.sidebar {
|
div.sidebar, aside.sidebar {
|
||||||
margin: 0 0 0.5em 1em;
|
margin: 0 0 0.5em 1em;
|
||||||
border: 1px solid #ddb;
|
border: 1px solid #ddb;
|
||||||
padding: 7px 7px 0 7px;
|
padding: 7px 7px 0 7px;
|
||||||
@ -234,7 +234,7 @@ p.sidebar-title {
|
|||||||
|
|
||||||
/* -- topics ---------------------------------------------------------------- */
|
/* -- topics ---------------------------------------------------------------- */
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
padding: 7px 7px 0 7px;
|
padding: 7px 7px 0 7px;
|
||||||
margin: 10px 0 10px 0;
|
margin: 10px 0 10px 0;
|
||||||
|
@ -254,7 +254,7 @@ div.seealso {
|
|||||||
border: 1px solid #ff6;
|
border: 1px solid #ff6;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ div.sphinxsidebar .searchformwrapper {
|
|||||||
|
|
||||||
/* -- sidebars -------------------------------------------------------------- */
|
/* -- sidebars -------------------------------------------------------------- */
|
||||||
|
|
||||||
div.sidebar {
|
div.sidebar, aside.sidebar {
|
||||||
margin: 0 0 0.5em 1em;
|
margin: 0 0 0.5em 1em;
|
||||||
border: 2px solid #c6d880;
|
border: 2px solid #c6d880;
|
||||||
background-color: #e6efc2;
|
background-color: #e6efc2;
|
||||||
@ -245,7 +245,7 @@ div.seealso {
|
|||||||
padding: 10px 20px 10px 60px;
|
padding: 10px 20px 10px 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
background: #eeeeee;
|
background: #eeeeee;
|
||||||
border: 2px solid #C6C9CB;
|
border: 2px solid #C6C9CB;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
|
@ -266,7 +266,7 @@ div.quotebar {
|
|||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,7 +506,7 @@ p.rubric {
|
|||||||
|
|
||||||
/* "Topics" */
|
/* "Topics" */
|
||||||
|
|
||||||
div.topic {
|
div.topic, aside.topic {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
padding: 0 7px 0 7px;
|
padding: 0 7px 0 7px;
|
||||||
|
@ -7,3 +7,4 @@ confval1 = True
|
|||||||
def setup(app):
|
def setup(app):
|
||||||
app.add_config_value('confval1', False, None)
|
app.add_config_value('confval1', False, None)
|
||||||
app.add_config_value('confval2', False, None)
|
app.add_config_value('confval2', False, None)
|
||||||
|
app.add_config_value('false_config', False, None)
|
||||||
|
@ -9,3 +9,13 @@ ifconfig
|
|||||||
|
|
||||||
egg
|
egg
|
||||||
|
|
||||||
|
Issue 10496 regression test
|
||||||
|
===========================
|
||||||
|
|
||||||
|
.. ifconfig:: false_config
|
||||||
|
|
||||||
|
`Link 1 <https://link1.example>`__
|
||||||
|
|
||||||
|
.. ifconfig:: false_config
|
||||||
|
|
||||||
|
`Link 2 <https://link2.example>`__
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
Regression test for issue 10495
|
||||||
|
===============================
|
||||||
|
|
||||||
|
:kbd:`spanish - inquisition`
|
@ -48,3 +48,12 @@ def test_missing_reference_conditional_pending_xref(app, status, warning):
|
|||||||
|
|
||||||
content = (app.outdir / 'index.html').read_text(encoding='utf8')
|
content = (app.outdir / 'index.html').read_text(encoding='utf8')
|
||||||
assert '<span class="n"><span class="pre">Age</span></span>' in content
|
assert '<span class="n"><span class="pre">Age</span></span>' in content
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.sphinx('html', testroot='transforms-post_transforms-keyboard',
|
||||||
|
freshenv=True)
|
||||||
|
def test_keyboard_hyphen_spaces(app):
|
||||||
|
"""Regression test for issue 10495, we want no crash."""
|
||||||
|
app.build()
|
||||||
|
assert "spanish" in (app.outdir / 'index.html').read_text(encoding='utf8')
|
||||||
|
assert "inquisition" in (app.outdir / 'index.html').read_text(encoding='utf8')
|
||||||
|
Loading…
Reference in New Issue
Block a user