Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Run ruff format
  • Loading branch information
encukou committed Jan 22, 2025
commit 829e4f065e54316a6532bab3725ee89940600f4c
16 changes: 5 additions & 11 deletions Doc/tools/extensions/grammar_snippet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@


class GrammarSnippetBase(SphinxDirective):
"""Common functionality for GrammarSnippetDirective & CompatProductionList.
"""
"""Common functionality for GrammarSnippetDirective & CompatProductionList."""

# The option/argument handling is left to the individual classes.

def make_grammar_snippet(self, options, content):
Expand Down Expand Up @@ -102,16 +102,10 @@ def make_link_to_token(self, group_name, name):
domain = self.env.domains['std']
obj_name = f"{group_name}:{name}"
prefix = f'grammar-token-{group_name}'
node_id = make_id(
self.env, self.state.document, prefix, name
)
node_id = make_id(self.env, self.state.document, prefix, name)
name_node['ids'].append(node_id)
self.state.document.note_implicit_target(
name_node, name_node
)
domain.note_object(
'token', obj_name, node_id, location=name_node
)
self.state.document.note_implicit_target(name_node, name_node)
domain.note_object('token', obj_name, node_id, location=name_node)

text_node = nodes.Text(name)
name_node += text_node
Expand Down