Skip to content

Add native links and reverse references to syntax diagrams - #809

Merged
ydah merged 1 commit into
ruby:masterfrom
ydah:linked-syntax-diagrams
Oct 2, 2026
Merged

ydah merged 1 commit into
ruby:masterfrom
ydah:linked-syntax-diagrams

Conversation

@ydah

@ydah ydah commented Sep 30, 2026

Copy link
Copy Markdown
Member

Syntax diagrams currently rely on JavaScript to match nonterminal names to rule headings. They also display helper symbols generated for midrule actions.

Use RailroadDiagrams::Document#rule_sections from railroad_diagrams 1.0.0 or later to add native SVG links and a “Referenced by” list to the standard --diagram output. Replace the existing JavaScript navigation with fragment links.

Omit midrule action helper rules ($@n and @n) and their references while retaining user-defined empty rules. Preserve rule and alternative order, and filter copies of rules to avoid changing the grammar used for parser generation.

@ydah
ydah merged commit aca15d3 into ruby:master Oct 2, 2026
23 checks passed
@ydah
ydah deleted the linked-syntax-diagrams branch October 2, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant