Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
adrianholovaty opened this issue May 16, 2024 · 5 comments
Closed

Comments

@adrianholovaty
Copy link
Contributor

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
Copy link
Contributor

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

@adrianholovaty
Copy link
Contributor Author

Done in 4a2dca5.

@lemzwerg
Copy link

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
Copy link
Contributor Author

@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
Copy link

OK, thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants