summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-02-22 17:39:56 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-02-22 17:39:56 +0900
commit2b70875f6a240bd5461276bd4e6598c61ccbc42d (patch)
tree53dcbf14e0ea73c32324da3fcd2b0bda7a73fc7e
parent8987f3c031236e8dd5c77ef49f902eb1dea488af (diff)
parentdf3c0448ddb1f3debbf91b669d4d85bfa5926514 (diff)
downloadsphinx-git-2b70875f6a240bd5461276bd4e6598c61ccbc42d.tar.gz
Merge branch 'drop_desc_signature_first' into 3.x
-rw-r--r--CHANGES1
-rw-r--r--doc/extdev/deprecated.rst5
-rw-r--r--sphinx/directives/__init__.py1
-rw-r--r--sphinx/domains/c.py1
-rw-r--r--sphinx/domains/cpp.py4
-rw-r--r--sphinx/domains/javascript.py1
-rw-r--r--sphinx/domains/python.py1
-rw-r--r--sphinx/domains/rst.py2
-rw-r--r--sphinx/writers/html.py4
-rw-r--r--sphinx/writers/html5.py4
10 files changed, 6 insertions, 18 deletions
diff --git a/CHANGES b/CHANGES
index fcd09f1b2..d324f11fc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -27,6 +27,7 @@ Incompatible changes
Deprecated
----------
+* ``desc_signature['first']``
* ``sphinx.directives.DescDirective``
* ``sphinx.domains.std.StandardDomain.add_object()``
* ``sphinx.parsers.Parser.app``
diff --git a/doc/extdev/deprecated.rst b/doc/extdev/deprecated.rst
index c6cb30ca1..484c76aba 100644
--- a/doc/extdev/deprecated.rst
+++ b/doc/extdev/deprecated.rst
@@ -26,6 +26,11 @@ The following is a list of deprecated interfaces.
- (will be) Removed
- Alternatives
+ * - ``desc_signature['first']``
+ -
+ - 3.0
+ - N/A
+
* - ``sphinx.directives.DescDirective``
- 3.0
- 5.0
diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py
index 61cd53302..fd447b551 100644
--- a/sphinx/directives/__init__.py
+++ b/sphinx/directives/__init__.py
@@ -169,7 +169,6 @@ class ObjectDescription(SphinxDirective):
# add a signature node for each signature in the current unit
# and add a reference target for it
signode = addnodes.desc_signature(sig, '')
- signode['first'] = False
node.append(signode)
try:
# name can also be a tuple, e.g. (classname, objname);
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py
index cc24df47e..539a52e59 100644
--- a/sphinx/domains/c.py
+++ b/sphinx/domains/c.py
@@ -203,7 +203,6 @@ class CObject(ObjectDescription):
if targetname not in self.state.document.ids:
signode['names'].append(targetname)
signode['ids'].append(targetname)
- signode['first'] = (not self.names)
self.state.document.note_explicit_target(signode)
domain = cast(CDomain, self.env.get_domain('c'))
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
index c89067852..3a23ff15a 100644
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -6490,7 +6490,6 @@ class CPPObject(ObjectDescription):
continue
if id not in self.state.document.ids:
signode['ids'].append(id)
- signode['first'] = (not self.names) # hmm, what is this about?
self.state.document.note_explicit_target(signode)
@property
@@ -6772,7 +6771,6 @@ class AliasTransform(SphinxTransform):
if ast is None:
# could not be parsed, so stop here
signode = addnodes.desc_signature(sig, '')
- signode['first'] = False
signode.clear()
signode += addnodes.desc_name(sig, sig)
node.replace_self(signode)
@@ -6816,7 +6814,6 @@ class AliasTransform(SphinxTransform):
if len(symbols) == 0:
signode = addnodes.desc_signature(sig, '')
- signode['first'] = False
node.append(signode)
signode.clear()
signode += addnodes.desc_name(sig, sig)
@@ -6830,7 +6827,6 @@ class AliasTransform(SphinxTransform):
options['tparam-line-spec'] = False
for s in symbols:
signode = addnodes.desc_signature(sig, '')
- signode['first'] = False
nodes.append(signode)
s.declaration.describe_signature(signode, 'markName', self.env, options)
node.replace_self(nodes)
diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py
index feb39bc9d..2a91d4a3a 100644
--- a/sphinx/domains/javascript.py
+++ b/sphinx/domains/javascript.py
@@ -109,7 +109,6 @@ class JSObject(ObjectDescription):
if fullname not in self.state.document.ids:
signode['names'].append(fullname)
signode['ids'].append(fullname.replace('$', '_S_'))
- signode['first'] = not self.names
self.state.document.note_explicit_target(signode)
domain = cast(JavaScriptDomain, self.env.get_domain('js'))
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
index 5403f499a..9353dcb4c 100644
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -362,7 +362,6 @@ class PyObject(ObjectDescription):
if fullname not in self.state.document.ids:
signode['names'].append(fullname)
signode['ids'].append(fullname)
- signode['first'] = (not self.names)
self.state.document.note_explicit_target(signode)
domain = cast(PythonDomain, self.env.get_domain('py'))
diff --git a/sphinx/domains/rst.py b/sphinx/domains/rst.py
index 81287c815..81c01fbf2 100644
--- a/sphinx/domains/rst.py
+++ b/sphinx/domains/rst.py
@@ -43,7 +43,6 @@ class ReSTMarkup(ObjectDescription):
if targetname not in self.state.document.ids:
signode['names'].append(targetname)
signode['ids'].append(targetname)
- signode['first'] = (not self.names)
self.state.document.note_explicit_target(signode)
domain = cast(ReSTDomain, self.env.get_domain('rst'))
@@ -133,7 +132,6 @@ class ReSTDirectiveOption(ReSTMarkup):
if targetname not in self.state.document.ids:
signode['names'].append(targetname)
signode['ids'].append(targetname)
- signode['first'] = (not self.names)
self.state.document.note_explicit_target(signode)
objname = ':'.join(filter(None, [directive_name, name]))
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
index ba202b549..e74c0334f 100644
--- a/sphinx/writers/html.py
+++ b/sphinx/writers/html.py
@@ -115,10 +115,6 @@ class HTMLTranslator(SphinxTranslator, BaseTranslator):
def visit_desc_signature(self, node: Element) -> None:
# the id is set automatically
self.body.append(self.starttag(node, 'dt'))
- # anchor for per-desc interactive data
- if node.parent['objtype'] != 'describe' \
- and node['ids'] and node['first']:
- self.body.append('<!--[%s]-->' % node['ids'][0])
def depart_desc_signature(self, node: Element) -> None:
if not node.get('is_multiline'):
diff --git a/sphinx/writers/html5.py b/sphinx/writers/html5.py
index a9f39cfdc..0c00a1fa4 100644
--- a/sphinx/writers/html5.py
+++ b/sphinx/writers/html5.py
@@ -87,10 +87,6 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
def visit_desc_signature(self, node: Element) -> None:
# the id is set automatically
self.body.append(self.starttag(node, 'dt'))
- # anchor for per-desc interactive data
- if node.parent['objtype'] != 'describe' \
- and node['ids'] and node['first']:
- self.body.append('<!--[%s]-->' % node['ids'][0])
def depart_desc_signature(self, node: Element) -> None:
if not node.get('is_multiline'):