mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove deprecated `make_old_id
` functions (#11360)
This commit is contained in:
parent
124957a89c
commit
8dd44d1e13
2
CHANGES
2
CHANGES
@ -9,6 +9,8 @@ Incompatible changes
|
||||
|
||||
* #11359: Remove long-deprecated aliases for ``MecabSplitter`` and
|
||||
``DefaultSplitter`` in ``sphinx.search.ja``.
|
||||
* #11360: Remove deprecated ``make_old_id`` functions in domain object
|
||||
description classes.
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
@ -3312,14 +3312,6 @@ class CObject(ObjectDescription[ASTDeclaration]):
|
||||
self.env.temp_data['c:parent_symbol'] = self.oldParentSymbol
|
||||
self.env.ref_context['c:parent_key'] = self.oldParentKey
|
||||
|
||||
def make_old_id(self, name: str) -> str:
|
||||
"""Generate old styled node_id for C objects.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return 'c.' + name
|
||||
|
||||
|
||||
class CMemberObject(CObject):
|
||||
object_type = 'member'
|
||||
|
@ -207,14 +207,6 @@ class JSObject(ObjectDescription[Tuple[str, str]]):
|
||||
self.env.ref_context['js:object'] = (objects[-1] if len(objects) > 0
|
||||
else None)
|
||||
|
||||
def make_old_id(self, fullname: str) -> str:
|
||||
"""Generate old styled node_id for JS objects.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return fullname.replace('$', '_S_')
|
||||
|
||||
def _toc_entry_name(self, sig_node: desc_signature) -> str:
|
||||
if not sig_node.get('_toc_parts'):
|
||||
return ''
|
||||
@ -321,14 +313,6 @@ class JSModule(SphinxDirective):
|
||||
ret.extend(content_node.children)
|
||||
return ret
|
||||
|
||||
def make_old_id(self, modname: str) -> str:
|
||||
"""Generate old styled node_id for JS modules.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return 'module-' + modname
|
||||
|
||||
|
||||
class JSXRefRole(XRefRole):
|
||||
def process_link(self, env: BuildEnvironment, refnode: Element,
|
||||
|
@ -1064,16 +1064,6 @@ class PyModule(SphinxDirective):
|
||||
ret.extend(content_node.children)
|
||||
return ret
|
||||
|
||||
def make_old_id(self, name: str) -> str:
|
||||
"""Generate old styled node_id.
|
||||
|
||||
Old styled node_id is incompatible with docutils' node_id.
|
||||
It can contain dots and hyphens.
|
||||
|
||||
.. note:: Old styled node_id was mainly used until Sphinx-3.0.
|
||||
"""
|
||||
return 'module-%s' % name
|
||||
|
||||
|
||||
class PyCurrentModule(SphinxDirective):
|
||||
"""
|
||||
|
@ -52,14 +52,6 @@ class ReSTMarkup(ObjectDescription[str]):
|
||||
def get_index_text(self, objectname: str, name: str) -> str:
|
||||
return ''
|
||||
|
||||
def make_old_id(self, name: str) -> str:
|
||||
"""Generate old styled node_id for reST markups.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return self.objtype + '-' + name
|
||||
|
||||
def _object_hierarchy_parts(self, sig_node: desc_signature) -> tuple[str, ...]:
|
||||
if 'fullname' not in sig_node:
|
||||
return ()
|
||||
@ -193,14 +185,6 @@ class ReSTDirectiveOption(ReSTMarkup):
|
||||
else:
|
||||
return ''
|
||||
|
||||
def make_old_id(self, name: str) -> str:
|
||||
"""Generate old styled node_id for directive options.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return '-'.join([self.objtype, self.current_directive, name])
|
||||
|
||||
|
||||
class ReSTRole(ReSTMarkup):
|
||||
"""
|
||||
|
@ -72,14 +72,6 @@ class GenericObject(ObjectDescription[str]):
|
||||
std = cast(StandardDomain, self.env.get_domain('std'))
|
||||
std.note_object(self.objtype, name, node_id, location=signode)
|
||||
|
||||
def make_old_id(self, name: str) -> str:
|
||||
"""Generate old styled node_id for generic objects.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return self.objtype + '-' + name
|
||||
|
||||
|
||||
class EnvVar(GenericObject):
|
||||
indextemplate = _('environment variable; %s')
|
||||
@ -144,14 +136,6 @@ class Target(SphinxDirective):
|
||||
|
||||
return ret
|
||||
|
||||
def make_old_id(self, name: str) -> str:
|
||||
"""Generate old styled node_id for targets.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return self.name + '-' + name
|
||||
|
||||
|
||||
class Cmdoption(ObjectDescription[str]):
|
||||
"""
|
||||
@ -228,11 +212,6 @@ class Cmdoption(ObjectDescription[str]):
|
||||
node_id = make_id(self.env, self.state.document, prefix, optname)
|
||||
signode['ids'].append(node_id)
|
||||
|
||||
old_node_id = self.make_old_id(prefix, optname)
|
||||
if old_node_id not in self.state.document.ids and \
|
||||
old_node_id not in signode['ids']:
|
||||
signode['ids'].append(old_node_id)
|
||||
|
||||
self.state.document.note_explicit_target(signode)
|
||||
|
||||
domain = cast(StandardDomain, self.env.get_domain('std'))
|
||||
@ -249,14 +228,6 @@ class Cmdoption(ObjectDescription[str]):
|
||||
entry = '; '.join([descr, option])
|
||||
self.indexnode['entries'].append(('pair', entry, signode['ids'][0], '', None))
|
||||
|
||||
def make_old_id(self, prefix: str, optname: str) -> str:
|
||||
"""Generate old styled node_id for cmdoption.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return nodes.make_id(prefix + '-' + optname)
|
||||
|
||||
|
||||
class Program(SphinxDirective):
|
||||
"""
|
||||
@ -515,14 +486,6 @@ class ProductionList(SphinxDirective):
|
||||
node.append(subnode)
|
||||
return [node]
|
||||
|
||||
def make_old_id(self, token: str) -> str:
|
||||
"""Generate old styled node_id for tokens.
|
||||
|
||||
.. note:: Old Styled node_id was used until Sphinx-3.0.
|
||||
This will be removed in Sphinx-5.0.
|
||||
"""
|
||||
return nodes.make_id('grammar-token-' + token)
|
||||
|
||||
|
||||
class TokenXRefRole(XRefRole):
|
||||
def process_link(self, env: BuildEnvironment, refnode: Element, has_explicit_title: bool,
|
||||
|
Loading…
Reference in New Issue
Block a user