You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build: the generated schemas name almost every type after a symbol ID #1297
mrdocs.rng and mrdocs.schema.json are generated from MrDocs's own metadata types. Of the 108 definitions in the RELAX NG schema, 100 are named S_ followed by a base58 ID. They should be named after the type they describe.
Problem
The two generated schemas under docs/modules/ROOT/attachments/schemas/generators/ are produced by the reflected schema generator (docs/mrdocs/extensions/schema.js). Eight definitions have readable names:
The JSON schema has the same problem: 8 readable entries in $defs and 95 IDs.
That script walks MrDocs's own record symbols and emits both schemas plus the DOM reference partial, so the naming rule is one function in it.
A user reading the schema to understand the XML output, or wiring the JSON schema into an editor, gets no help from the names. The IDs also move when Clang changes how it computes them, so a schema regeneration produces a large meaningless diff.
Proposed solution
Each definition is named after the C++ type it reflects, for example FunctionSymbol or RecordTranche, with a documented rule for making the name unique when two reflected types share an unqualified name.
The symbol ID stays available as the fallback for anything the rule cannot name.
Regeneration and checking go through utils/codegen/generate-schema.sh and the schema-check test. The xml-lint test validates every golden XML fixture against the RELAX NG schema, so it will catch a rename that breaks a reference. Both schemas are also compiled in CI, the JSON one with ajv.
Activity
build: schema definitions are named after the types they describe