| |
@@ -1,42 +0,0 @@
|
| |
- From f0480ddd2d3cb04b784cf7ea697f792b45c689cc Mon Sep 17 00:00:00 2001
|
| |
- From: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
| |
- Date: Wed, 17 Nov 2021 12:31:25 +0100
|
| |
- Subject: [PATCH] Fixed crash building HTML docs since Sphinx 4.3.
|
| |
-
|
| |
- See https://github.com/sphinx-doc/sphinx/commit/dd2ff3e911c751c06c81f494128fba56d8ecbafd.
|
| |
- ---
|
| |
- docs/_ext/djangodocs.py | 10 ++++++++--
|
| |
- 1 file changed, 8 insertions(+), 2 deletions(-)
|
| |
-
|
| |
- diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py
|
| |
- index dfc9e12682f3..2829d581cdb8 100644
|
| |
- --- a/docs/_ext/djangodocs.py
|
| |
- +++ b/docs/_ext/djangodocs.py
|
| |
- @@ -8,7 +8,7 @@
|
| |
- from docutils import nodes
|
| |
- from docutils.parsers.rst import Directive
|
| |
- from docutils.statemachine import ViewList
|
| |
- -from sphinx import addnodes
|
| |
- +from sphinx import addnodes, version_info as sphinx_version
|
| |
- from sphinx.builders.html import StandaloneHTMLBuilder
|
| |
- from sphinx.directives.code import CodeBlock
|
| |
- from sphinx.domains.std import Cmdoption
|
| |
- @@ -115,11 +115,17 @@ class DjangoHTMLTranslator(HTMLTranslator):
|
| |
- def visit_table(self, node):
|
| |
- self.context.append(self.compact_p)
|
| |
- self.compact_p = True
|
| |
- - self._table_row_index = 0 # Needed by Sphinx
|
| |
- + # Needed by Sphinx.
|
| |
- + if sphinx_version >= (4, 3):
|
| |
- + self._table_row_indices.append(0)
|
| |
- + else:
|
| |
- + self._table_row_index = 0
|
| |
- self.body.append(self.starttag(node, 'table', CLASS='docutils'))
|
| |
-
|
| |
- def depart_table(self, node):
|
| |
- self.compact_p = self.context.pop()
|
| |
- + if sphinx_version >= (4, 3):
|
| |
- + self._table_row_indices.pop()
|
| |
- self.body.append('</table>\n')
|
| |
-
|
| |
- def visit_desc_parameterlist(self, node):
|
| |
This implements https://fedoraproject.org/wiki/Changes/Django4.0,
also fixes rhbz# 2006537
For more info on Django 4.0, see the upstream project news
https://www.djangoproject.com/weblog/2021/dec/07/django-40-released/