json-pretty-html
Transforms a JSON object into an HTML string. Allows selecting a subset of the object and highlight it with a CSS class.
Usage
var json = "id": 2 "name": "An ice sculpture" "price": 1250 "tags": "cold" "ice" "dimensions": "length": 70 "width": 120 "height": 95 "warehouseLocation": "latitude": -7875 "longitude": 204 ;var prettyHtml = default;var html = ;
With a nice CSS, the result will be:

CSS
You can use the default 'darcula' like stylesheet.
Or you can define your own styles. See below the list of CSS classes used in the generated HTML:
CSS Class | Purpose |
---|---|
json-pretty | A div grouping several lines, delimited by the start/end of the object or the start/end of the selection |
json-selected | The current selection div, if any. Always associated with the json-pretty class. |
json-key | Object key, excluding double quotes |
json-string | String value, excluding double quotes |
json-number | Number value |
json-boolean | Boolean value |