1
0
mirror of https://github.com/django/django.git synced 2025-07-22 18:49:25 +00:00

[1.8.x] Removed a docs workaround for an old Sphinx version.

Backport of c315f9602418d2fcfe194b1ef2d0d7c325cac151 from master
This commit is contained in:
Tim Graham 2015-11-16 11:33:34 -05:00
parent 8aee493bd4
commit 7dc480e4f7
2 changed files with 2 additions and 14 deletions

View File

@ -7,7 +7,7 @@ import re
from docutils import nodes from docutils import nodes
from docutils.parsers.rst import Directive, directives from docutils.parsers.rst import Directive, directives
from sphinx import __version__ as sphinx_ver, addnodes from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.util.console import bold from sphinx.util.console import bold
from sphinx.util.nodes import set_source_info from sphinx.util.nodes import set_source_info
@ -256,18 +256,6 @@ class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
def depart_desc_parameterlist(self, node): def depart_desc_parameterlist(self, node):
self.body.append(')') self.body.append(')')
if sphinx_ver < '1.0.8':
#
# Don't apply smartypants to literal blocks
#
def visit_literal_block(self, node):
self.no_smarty += 1
SmartyPantsHTMLTranslator.visit_literal_block(self, node)
def depart_literal_block(self, node):
SmartyPantsHTMLTranslator.depart_literal_block(self, node)
self.no_smarty -= 1
# #
# Turn the "new in version" stuff (versionadded/versionchanged) into a # Turn the "new in version" stuff (versionadded/versionchanged) into a
# better callout -- the Sphinx default is just a little span, # better callout -- the Sphinx default is just a little span,

View File

@ -36,7 +36,7 @@ sys.path.append(abspath(join(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.8'
# 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.