Add grammar reference with railroad syntax diagrams#372
Open
Add grammar reference with railroad syntax diagrams#372
Conversation
Generated split-mode MDX pages with co-located SVG syntax diagrams for Sync Rules (15 productions) and Sync Streams (26 productions). Includes index pages, lexical rules pages, and docs.json nav entries.
…ammar reference Replace 85 per-production MDX/SVG files with 2 flat index.mdx pages (one per grammar) plus co-located SVGs. Each production section now includes Used by / References cross-links. Simplify docs.json nav.
c95d411 to
beaabb4
Compare
Contributor
|
I'm happy with the general approach. @benitav What do you think about this? Any tweaks you'd like? Keep in mind it's auto-generated, but we have a lot of control in how it's generated. |
Collaborator
|
Not sure if this level of feedback is useful (mostly polish in the page, not the generated content) but as someone who isn’t familiar with railroad diagrams and can’t easily parse them, but got a high-level understanding now.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR goes in hand with powersync-ja/powersync-service#535
Summary
<style>and<text>elements), so SVGs are static files referenced via<img>tagsStructure
sync/grammar/sync-rules/index.mdx— flat page with all 15 Sync Rules productions + lexical rulessync/grammar/sync-rules/*.svg— 15 co-located SVG diagramssync/grammar/sync-streams/index.mdx— flat page with all 26 Sync Streams productions + lexical rulessync/grammar/sync-streams/*.svg— 26 co-located SVG diagramsGenerated from
These pages are generated by
packages/sync-rules/scripts/generate-grammar-docs.tsin the powersync-service repo (branchgrammar-svgs):pnpm exec tsx scripts/generate-grammar-docs.ts --outdir /path/to/powersync-docs/sync/grammar --base-url /sync/grammar