mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Removed unneeded ReSTXRefRole and a bit of documentation.
This commit is contained in:
parent
2c89f1372a
commit
24cc2fd09c
@ -21,6 +21,9 @@ from sphinx.util.nodes import make_refnode
|
|||||||
dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$')
|
dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$')
|
||||||
|
|
||||||
class ReSTMarkup(ObjectDescription):
|
class ReSTMarkup(ObjectDescription):
|
||||||
|
"""
|
||||||
|
Description of generic reST markup.
|
||||||
|
"""
|
||||||
|
|
||||||
def add_target_and_index(self, name, sig, signode):
|
def add_target_and_index(self, name, sig, signode):
|
||||||
if name not in self.state.document.ids:
|
if name not in self.state.document.ids:
|
||||||
@ -52,6 +55,9 @@ class ReSTMarkup(ObjectDescription):
|
|||||||
|
|
||||||
|
|
||||||
class ReSTDirective(ReSTMarkup):
|
class ReSTDirective(ReSTMarkup):
|
||||||
|
"""
|
||||||
|
Description of reST directive.
|
||||||
|
"""
|
||||||
def handle_signature(self, sig, signode):
|
def handle_signature(self, sig, signode):
|
||||||
if not sig.startswith('.'):
|
if not sig.startswith('.'):
|
||||||
dec_sig = '.. %s::' % sig
|
dec_sig = '.. %s::' % sig
|
||||||
@ -68,13 +74,13 @@ class ReSTDirective(ReSTMarkup):
|
|||||||
return name
|
return name
|
||||||
|
|
||||||
class ReSTRole(ReSTMarkup):
|
class ReSTRole(ReSTMarkup):
|
||||||
|
"""
|
||||||
|
Description of reST role.
|
||||||
|
"""
|
||||||
def handle_signature(self, sig, signode):
|
def handle_signature(self, sig, signode):
|
||||||
signode += addnodes.desc_name(':%s:' % sig, ':%s:' % sig)
|
signode += addnodes.desc_name(':%s:' % sig, ':%s:' % sig)
|
||||||
return sig
|
return sig
|
||||||
|
|
||||||
class ReSTXRefRole(XRefRole):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class ReSTDomain(Domain):
|
class ReSTDomain(Domain):
|
||||||
"""ReStructuredText domain."""
|
"""ReStructuredText domain."""
|
||||||
name = 'rst'
|
name = 'rst'
|
||||||
@ -89,8 +95,8 @@ class ReSTDomain(Domain):
|
|||||||
'role': ReSTRole,
|
'role': ReSTRole,
|
||||||
}
|
}
|
||||||
roles = {
|
roles = {
|
||||||
'dir': ReSTXRefRole(),
|
'dir': XRefRole(),
|
||||||
'role': ReSTXRefRole(),
|
'role': XRefRole(),
|
||||||
}
|
}
|
||||||
initial_data = {
|
initial_data = {
|
||||||
'objects': {}, # fullname -> docname, objtype
|
'objects': {}, # fullname -> docname, objtype
|
||||||
|
Loading…
Reference in New Issue
Block a user