mirror of
https://github.com/django/django.git
synced 2025-01-03 06:55:47 +00:00
Removed unnecessary workarounds for Sphinx < 4.3.0.
Unnecessary since ebf25555bb
.
This commit is contained in:
parent
fcfbf08abe
commit
60ac77f32e
@ -9,7 +9,6 @@ from docutils import nodes
|
|||||||
from docutils.parsers.rst import Directive
|
from docutils.parsers.rst import Directive
|
||||||
from docutils.statemachine import ViewList
|
from docutils.statemachine import ViewList
|
||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
from sphinx import version_info as sphinx_version
|
|
||||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||||
from sphinx.directives.code import CodeBlock
|
from sphinx.directives.code import CodeBlock
|
||||||
from sphinx.domains.std import Cmdoption
|
from sphinx.domains.std import Cmdoption
|
||||||
@ -118,16 +117,12 @@ class DjangoHTMLTranslator(HTMLTranslator):
|
|||||||
self.context.append(self.compact_p)
|
self.context.append(self.compact_p)
|
||||||
self.compact_p = True
|
self.compact_p = True
|
||||||
# Needed by Sphinx.
|
# Needed by Sphinx.
|
||||||
if sphinx_version >= (4, 3):
|
self._table_row_indices.append(0)
|
||||||
self._table_row_indices.append(0)
|
|
||||||
else:
|
|
||||||
self._table_row_index = 0
|
|
||||||
self.body.append(self.starttag(node, "table", CLASS="docutils"))
|
self.body.append(self.starttag(node, "table", CLASS="docutils"))
|
||||||
|
|
||||||
def depart_table(self, node):
|
def depart_table(self, node):
|
||||||
self.compact_p = self.context.pop()
|
self.compact_p = self.context.pop()
|
||||||
if sphinx_version >= (4, 3):
|
self._table_row_indices.pop()
|
||||||
self._table_row_indices.pop()
|
|
||||||
self.body.append("</table>\n")
|
self.body.append("</table>\n")
|
||||||
|
|
||||||
def visit_desc_parameterlist(self, node):
|
def visit_desc_parameterlist(self, node):
|
||||||
|
Loading…
Reference in New Issue
Block a user