Skip to content

Commit

Permalink
[3.2.x] Fixed #34756 -- Fixed docs HTML build on Sphinx 7.1+.
Browse files Browse the repository at this point in the history
Backport of b3e0170 from main
  • Loading branch information
smithdc1 authored and felixxm committed Aug 3, 2023
1 parent 848fe70 commit 75418f8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docs/_ext/djangodocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,23 @@ def depart_table(self, node):

def visit_desc_parameterlist(self, node):
self.body.append('(') # by default sphinx puts <big> around the "("
self.first_param = 1
self.optional_param_level = 0
self.param_separator = node.child_text_separator
self.required_params_left = sum(isinstance(c, addnodes.desc_parameter) for c in node.children)
# Counts 'parameter groups' being either a required parameter, or a set
# of contiguous optional ones.
required_params = [
isinstance(c, addnodes.desc_parameter) for c in node.children
]
# How many required parameters are left.
self.required_params_left = sum(required_params)
if sphinx_version < (7, 1):
self.first_param = 1
else:
self.is_first_param = True
self.params_left_at_level = 0
self.param_group_index = 0
self.list_is_required_param = required_params
self.multi_line_parameter_list = False

def depart_desc_parameterlist(self, node):
self.body.append(')')
Expand Down

0 comments on commit 75418f8

Please sign in to comment.