mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Enable automatic formatting for `sphinx/domains/index.py`
This commit is contained in:
@@ -394,7 +394,6 @@ preview = true
|
||||
quote-style = "single"
|
||||
exclude = [
|
||||
"sphinx/builders/latex/constants.py",
|
||||
"sphinx/domains/index.py",
|
||||
"sphinx/domains/javascript.py",
|
||||
"sphinx/domains/math.py",
|
||||
"sphinx/domains/python/_annotations.py",
|
||||
|
||||
@@ -48,14 +48,15 @@ class IndexDomain(Domain):
|
||||
"""Process a document after it is read by the environment."""
|
||||
entries = self.entries.setdefault(env.docname, [])
|
||||
for node in list(document.findall(addnodes.index)):
|
||||
node_entries = node['entries']
|
||||
try:
|
||||
for (entry_type, value, _target_id, _main, _category_key) in node['entries']:
|
||||
for entry_type, value, _target_id, _main, _category_key in node_entries:
|
||||
split_index_msg(entry_type, value)
|
||||
except ValueError as exc:
|
||||
logger.warning(str(exc), location=node)
|
||||
node.parent.remove(node)
|
||||
else:
|
||||
for entry in node['entries']:
|
||||
for entry in node_entries:
|
||||
entries.append(entry)
|
||||
|
||||
|
||||
@@ -88,7 +89,9 @@ class IndexDirective(SphinxDirective):
|
||||
indexnode['inline'] = False
|
||||
self.set_source_info(indexnode)
|
||||
for entry in arguments:
|
||||
indexnode['entries'].extend(process_index_entry(entry, targetnode['ids'][0]))
|
||||
indexnode['entries'].extend(
|
||||
process_index_entry(entry, targetnode['ids'][0])
|
||||
)
|
||||
return [indexnode, targetnode]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user