mohsen1 / pretty-json

Pretty JSON HTML Custom Element
https://azimi.me/pretty-json
13 stars 0 forks source link

Feat: Collapse Short Nested JSON #18

Open jlukic opened 3 weeks ago

jlukic commented 3 weeks ago

Thanks again for your project, it's been very helpful to have a web component implementation of something so useful like this. I'm using it to display the JSON for some components in my rewrite of Semantic UI. Here's a screenshot to give you an idea

image

Feat Request

Showing inline json can helpful for small data structures to make it easier to preview the overall structure without having to unfold content each time if the content length permits showing it inline.

Chrome Devtools

before expanding image

after expanding image

Pretty-JSON

And here's the same JSON in pretty-json

before expanding image

after expanding image

mohsen1 commented 2 weeks ago

This is a great feature request, however I think it needs a major rearchitecture of the whole rendering algorithm to decide when to "expand inline". I might look into it but can't promise anything too soon