Dear Jason,
I like this a lot! And have been hoping for some time to have something better
than our current "schema browser".
https://pretextbook.org/doc/schema/
because (a) it costs money, (b) it is hard to configure, and (c) it has a
shortcoming (see below).
A couple of twists:
1. I suppose you have thought of (i) rebuilding on a push to the repository
that contains changes to the schema (yes, I know what I'm asking for here!), and
(ii) testing the examples against the schema (as the schema evolves?).
2. Maybe less obvious. RELAX-NG lets you "condition" on attributes. In other
words, an element could have two descriptions, with different possible
attributes (and their values?), and accordingly have different collections of
children. (I think.)
We convert to a W3 Schema (*.xsd) to feed the tool that creates the browser
linked above. But this other schema lacks this sort of expressive power. So
the conversion emits messages about "approximating", and hence the link above
has material is not entirely accurate. Of course, I can't find, or remember, a
good example. But here is one example.
An #li can be raw text, or structured with #p, etc., so very different sorts of
children. The former scenario does not allow a @component, while the latter one
does. That is not really intentional, just an accident of recycling certain
patterns instead of making new ones. But I think there are cases where it is
intentional.
Looking forward to discussing this more.
Rob