Closed ggrossetie closed 1 year ago
@ggrossetie is it possible to switch between the 2 views ?
is it possible to switch between the 2 views ?
Between a code block and a tree viewer? To clarify, you want to configure which one you want to use (for a specific JSON source block) or both at the same time with a button to switch between the 2 views?
In my opinion, we should use one or the other. For the record, we can add a button to "expand all" in the JSON viewer and it has a copy button.
Some pages contain large JSON5 file (i.e., with comments):
Reference: https://docs.feelpp.org/cases/latest/heatfluid/2Dbuilding_NS/README.html
One solution would be to use a JSON tree viewer to show the first 2 levels by default:
One downside is that comments are not supported when displaying a JSON as a tree (because comments are not part of any "node").
Another idea would be to set a maximum height on JSON blocks:
As a side note, Highlight.js supports comments so the syntax highlighting should work as expected:
https://github.com/highlightjs/highlight.js/blob/8c2c2c6b8050b2c14bc30bfbb0b3fa79625db44a/src/languages/json.js#L46-L47