w3c / mnx

Music Notation CG next-generation music markup proposal.
179 stars 18 forks source link

Change docgenerator's JSON serialization to use lists of strings #340

Closed adrianholovaty closed 5 months ago

adrianholovaty commented 6 months ago

Currently the diffs to the data.json file are hard to read, especially for long strings that contain newlines. One way to improve this would be to change the serialization to always store strings as arrays, where each element of the array is a line — effectively just splitting the string by newlines.

Let's give that a shot to see whether it's an improvement (it would otherwise have zero effect on the docs system).

mscuthbert commented 6 months ago

Probably would need a way to read in a string for parsing the current specs but write out a list.

adrianholovaty commented 5 months ago

Done in 4a2dca56.

lemzwerg commented 5 months ago

What about using HJSON to maintain, say, mnx-schema.hjson, and from which mnx-schema.json can be created automatically? The biggest advantages of HJSON are the possibility to have comments – and the possibility to have multi-line strings.

adrianholovaty commented 5 months ago

@lemzwerg We've already got a system that generates the mnx-schema.json file automatically, and it's much richer than HJSON because it also generates the entirety of the HTML docs and stores a whole bunch of extra metadata. See more info here if you're interested: https://github.com/w3c/mnx/tree/main/docgenerator

lemzwerg commented 5 months ago

OK, thanks for the info.