[1.2.X] Rolled back r146331, r14640 (partially) and r14625 so 1.2.X docs are still buildable with Sphinx 0.6.x for the benefit of downstream packagers shipping stable releases of Django.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8301a8b9c2
commit
47fe010a8e
@ -83,7 +83,10 @@ 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)
|
||||||
xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, self.state)
|
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
|
||||||
node.extend(xrefs[0])
|
node.extend(xrefs[0])
|
||||||
node['version'] = arg0
|
node['version'] = arg0
|
||||||
else:
|
else:
|
||||||
@ -193,7 +196,10 @@ 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()"""
|
||||||
from sphinx.domains.std import option_desc_re
|
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
|
||||||
count = 0
|
count = 0
|
||||||
firstname = ''
|
firstname = ''
|
||||||
for m in option_desc_re.finditer(sig):
|
for m in option_desc_re.finditer(sig):
|
||||||
@ -233,6 +239,17 @@ class DjangoStandaloneHTMLBuilder(StandaloneHTMLBuilder):
|
|||||||
self.warn("cannot create templatebuiltins.js due to missing simplejson dependency")
|
self.warn("cannot create templatebuiltins.js due to missing simplejson dependency")
|
||||||
return
|
return
|
||||||
self.info(bold("writing templatebuiltins.js..."))
|
self.info(bold("writing templatebuiltins.js..."))
|
||||||
|
try:
|
||||||
|
# Sphinx < 1.0
|
||||||
|
xrefs = self.env.reftargets.items()
|
||||||
|
templatebuiltins = dict([('ttags', [n for ((t,n),(l,a)) in xrefs
|
||||||
|
if t == 'ttag' and
|
||||||
|
l == 'ref/templates/builtins']),
|
||||||
|
('tfilters', [n for ((t,n),(l,a)) in xrefs
|
||||||
|
if t == 'tfilter' and
|
||||||
|
l == 'ref/templates/builtins'])])
|
||||||
|
except AttributeError:
|
||||||
|
# Sphinx >= 1.0
|
||||||
xrefs = self.env.domaindata["std"]["objects"]
|
xrefs = self.env.domaindata["std"]["objects"]
|
||||||
templatebuiltins = dict([('ttags', [n for ((t,n), (l,a)) in xrefs.items()
|
templatebuiltins = dict([('ttags', [n for ((t,n), (l,a)) in xrefs.items()
|
||||||
if t == 'templatetag' and
|
if t == 'templatetag' and
|
||||||
|
@ -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.
|
||||||
|
@ -15,12 +15,8 @@ Sphinx -- ``easy_install Sphinx`` should do the trick.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Building the Django documentation requires Sphinx 1.0.2 or newer. Sphinx
|
The Django documentation can be generated with Sphinx version 0.6 or
|
||||||
also requires the Pygments__ library for syntax highlighting; building the
|
newer, but we recommend using Sphinx 1.0.2 or newer.
|
||||||
Django documentation requires Pygments 1.1 or newer (a new-enough version
|
|
||||||
should automatically be installed along with Sphinx).
|
|
||||||
|
|
||||||
__ http://pygments.org
|
|
||||||
|
|
||||||
Then, building the HTML is easy; just ``make html`` from the ``docs`` directory.
|
Then, building the HTML is easy; just ``make html`` from the ``docs`` directory.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user