diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2010-11-19 23:23:17 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2010-11-19 23:23:17 +0000 |
| commit | 8d3e66fad61c96aa2269a2a3ca38fb3f5cab1189 (patch) | |
| tree | 5a91832b0195de6b90adfe245f513a3fffc596db | |
| parent | 04fec1be965ad70304635bf54c4843273e59b2a4 (diff) | |
[1.2.X] 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.
Backport of [14631] from trunk
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | docs/_ext/djangodocs.py | 10 | ||||
| -rw-r--r-- | docs/conf.py | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py index 022ec3acd3..2e750c030c 100644 --- a/docs/_ext/djangodocs.py +++ b/docs/_ext/djangodocs.py @@ -83,10 +83,7 @@ class VersionDirective(Directive): if not is_nextversion: if len(self.arguments) == 1: linktext = 'Please, see the release notes </releases/%s>' % (arg0) - try: - 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 + xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, self.state) node.extend(xrefs[0]) node['version'] = arg0 else: @@ -196,10 +193,7 @@ def parse_django_admin_node(env, sig, signode): def parse_django_adminopt_node(env, sig, signode): """A copy of sphinx.directives.CmdoptionDesc.parse_signature()""" - try: - from sphinx.domains.std import option_desc_re # Sphinx >= 1.0 - except ImportError: - from sphinx.directives.desc import option_desc_re # Sphinx < 1.0 + from sphinx.domains.std import option_desc_re count = 0 firstname = '' for m in option_desc_re.finditer(sig): diff --git a/docs/conf.py b/docs/conf.py index ac6aed1fb9..3c3a5d5f33 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")) # -- General configuration ----------------------------------------------------- # 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 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
