Data Structure Visualization (JSON)

Snow Flower Text supports visualization of JSON data structure as an extension of AsciiDoc. JSON is a text-based data description language that is widely used in web service data exchange and application configuration data. By visualizing the structure, the hierarchical structure becomes clearer, which is useful for understanding the entire data in a short time.

The data structure visualization (JSON) feature for AsciiDoc is an original extension of Snow Flower Text.

For example, the response data of the Weather API is Even if you use JSON data with pretty format and syntax highlighting It is difficult to read the hierarchical structure in text format.

{
"coord": {
"lon": -122.08,
"lat": 37.39
},
"weather": [
{
"id": 800,
"main": "Clear",
"description": "clear sky",
"icon": "01d"
}
],
"base": "stations",
"main": {
"temp": 282.55,
"feels_like": 281.86,
"temp_min": 280.37,
"temp_max": 284.26,
"pressure": 1023,
"humidity": 100
},
"visibility": 16093,
"wind": {
"speed": 1.5,
"deg": 350
},
"clouds": {
"all": 1
},
"dt": 1560350645,
"sys": {
"type": 1,
"id": 5122,
"message": 0.0139,
"country": "US",
"sunrise": 1560343627,
"sunset": 1560396563
},
"timezone": -25200,
"id": 420006353,
"name": "Mountain View",
"cod": 200
}

By visualizing the data structure, this will be rendered as follows

You should now be able to see the whole picture at a glance. This is the effect of data structure visualization.

How to use

The json block can be used to visualize the structure of JSON data.

[json]
--------------------------------------
JSON data
--------------------------------------

For example, you can write the following

[json]
--------------------------------------
{
"coord": {
"lon": -122.08,
"lat": 37.39
},
"weather": [
{
"id": 800,
"main": "Clear",
"description": "clear sky",
"icon": "01d"
}
],
"base": "stations",
"main": {
"temp": 282.55,
"feels_like": 281.86,
"temp_min": 280.37,
"temp_max": 284.26,
"pressure": 1023,
"humidity": 100
},
"visibility": 16093,
"wind": {
"speed": 1.5,
"deg": 350
},
"clouds": {
"all": 1
},
"dt": 1560350645,
"sys": {
"type": 1,
"id": 5122,
"message": 0.0139,
"country": "US",
"sunrise": 1560343627,
"sunset": 1560396563
},
"timezone": -25200,
"id": 420006353,
"name": "Mountain View",
"cod": 200
}
--------------------------------------

It is possible to highlight specified properties of JSON data. In this case, use the #highlight command.

[json]
--------------------------------------
#highlight "coord"
#highlight "coord" / "lon"
#highlight "coord" / "lat"

{
"coord": {
"lon": -122.08,
"lat": 37.39
},
"weather": [
{
"id": 800,
"main": "Clear",
"description": "clear sky",
"icon": "01d"
}
],
"base": "stations",
"main": {
"temp": 282.55,
"feels_like": 281.86,
"temp_min": 280.37,
"temp_max": 284.26,
"pressure": 1023,
"humidity": 100
},
"visibility": 16093,
"wind": {
"speed": 1.5,
"deg": 350
},
"clouds": {
"all": 1
},
"dt": 1560350645,
"sys": {
"type": 1,
"id": 5122,
"message": 0.0139,
"country": "US",
"sunrise": 1560343627,
"sunset": 1560396563
},
"timezone": -25200,
"id": 420006353,
"name": "Mountain View",
"cod": 200
}
--------------------------------------
Download on the Mac App Store