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 (read from the source text, not from
serde_json’s map).
The committed artifact (site/src/generated/grammar.json) is drift-guarded by
xtask/tests/docs_consistency/generated_grammar_json.rs; regenerate with BYNK_BLESS=1.