pub fn render_site_json(grammar_json: &str) -> StringExpand description
Render the grammar as the JSON document the documentation site consumes. The
{{#grammar}} remark directive looks each rule up in productions (the same
<name> ::= <rhs> line render_production embeds, over embeddable_rules),
and the full-grammar page reads appendix (render_appendix). Because both
come from the same renderer as the mdBook preprocessor, the site cannot drift
from the book. Object keys preserve grammar order (serde_json preserve_order).
The committed artifact (site/src/generated/grammar.json) is drift-guarded by
bynk-grammar/tests/generated_grammar_json.rs; regenerate with BYNK_BLESS=1.