浏览代码

Removed a docs workaround for an old Sphinx version.

Tim Graham 9 年之前
父节点
当前提交
c315f96024
共有 2 个文件被更改,包括 2 次插入14 次删除
  1. 1 13
      docs/_ext/djangodocs.py
  2. 1 1
      docs/conf.py

+ 1 - 13
docs/_ext/djangodocs.py

@@ -7,7 +7,7 @@ import re
 
 from docutils import nodes
 from docutils.parsers.rst import directives
-from sphinx import __version__ as sphinx_ver, addnodes
+from sphinx import addnodes
 from sphinx.builders.html import StandaloneHTMLBuilder
 from sphinx.util.compat import Directive
 from sphinx.util.console import bold
@@ -254,18 +254,6 @@ class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
     def depart_desc_parameterlist(self, node):
         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
     # better callout -- the Sphinx default is just a little span,

+ 1 - 1
docs/conf.py

@@ -27,7 +27,7 @@ sys.path.append(abspath(join(dirname(__file__), "_ext")))
 # -- General configuration -----------------------------------------------------
 
 # 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
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.