mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Removed compatibility with Sphinx < 1.0 workarounds in our extension code. Also, started to use the 'needs_sphinx' Sphinx config var.
Follow up on r14624. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14631 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c0adc62fcc
commit
f609306349
@ -83,10 +83,7 @@ class VersionDirective(Directive):
|
|||||||
if not is_nextversion:
|
if not is_nextversion:
|
||||||
if len(self.arguments) == 1:
|
if len(self.arguments) == 1:
|
||||||
linktext = 'Please, see the release notes </releases/%s>' % (arg0)
|
linktext = 'Please, see the release notes </releases/%s>' % (arg0)
|
||||||
try:
|
xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, self.state)
|
||||||
xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, self.state) # Sphinx >= 1.0
|
|
||||||
except AttributeError:
|
|
||||||
xrefs = roles.xfileref_role('doc', linktext, linktext, self.lineno, self.state) # Sphinx < 1.0
|
|
||||||
node.extend(xrefs[0])
|
node.extend(xrefs[0])
|
||||||
node['version'] = arg0
|
node['version'] = arg0
|
||||||
else:
|
else:
|
||||||
@ -196,10 +193,7 @@ def parse_django_admin_node(env, sig, signode):
|
|||||||
|
|
||||||
def parse_django_adminopt_node(env, sig, signode):
|
def parse_django_adminopt_node(env, sig, signode):
|
||||||
"""A copy of sphinx.directives.CmdoptionDesc.parse_signature()"""
|
"""A copy of sphinx.directives.CmdoptionDesc.parse_signature()"""
|
||||||
try:
|
from sphinx.domains.std import option_desc_re
|
||||||
from sphinx.domains.std import option_desc_re # Sphinx >= 1.0
|
|
||||||
except ImportError:
|
|
||||||
from sphinx.directives.desc import option_desc_re # Sphinx < 1.0
|
|
||||||
count = 0
|
count = 0
|
||||||
firstname = ''
|
firstname = ''
|
||||||
for m in option_desc_re.finditer(sig):
|
for m in option_desc_re.finditer(sig):
|
||||||
|
@ -22,7 +22,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext"))
|
|||||||
# -- General configuration -----------------------------------------------------
|
# -- General configuration -----------------------------------------------------
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
#needs_sphinx = '1.0'
|
needs_sphinx = '1.0'
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user