Skip to content

gh-127833: Docs: Add a grammar-snippet directive & replace productionlist #127835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Feb 5, 2025
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
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy