mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-23 01:55:48 +08:00
Add JSON text renderer (#1086)
* Add JsonText widget to render highlighted JSON Closes #1051
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
┌─Some JSON───────────────────────────────────┐
|
||||
│ { │
|
||||
│ "id": "0001", │
|
||||
│ "type": "donut", │
|
||||
│ "name": "Cake", │
|
||||
│ "ppu": 0.55, │
|
||||
│ "foo": true, │
|
||||
│ "bar": false, │
|
||||
│ "qux": 32, │
|
||||
│ "corgi": null, │
|
||||
│ "batters": { │
|
||||
│ "batter": [ │
|
||||
│ { │
|
||||
│ "id": "1001", │
|
||||
│ "type": "Regular", │
|
||||
│ "min": 0 │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "1002", │
|
||||
│ "type": "Chocolate", │
|
||||
│ "min": 0.32 │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "1003", │
|
||||
│ "min": 12.32, │
|
||||
│ "type": "Blueberry" │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "1004", │
|
||||
│ "min": 0.32E-12, │
|
||||
│ "type": "Devil's Food" │
|
||||
│ } │
|
||||
│ ] │
|
||||
│ }, │
|
||||
│ "topping": [ │
|
||||
│ { │
|
||||
│ "id": "5001", │
|
||||
│ "min": 0.32e-12, │
|
||||
│ "type": "None" │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "5002", │
|
||||
│ "min": 0.32E+12, │
|
||||
│ "type": "Glazed" │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "5005", │
|
||||
│ "min": 0.32e+12, │
|
||||
│ "type": "Sugar" │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "5007", │
|
||||
│ "min": 0.32e12, │
|
||||
│ "type": "Powdered Sugar" │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "5006", │
|
||||
│ "type": "Chocolate with Sprinkles" │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "5003", │
|
||||
│ "type": "Chocolate" │
|
||||
│ }, │
|
||||
│ { │
|
||||
│ "id": "5004", │
|
||||
│ "type": "Maple" │
|
||||
│ } │
|
||||
│ ] │
|
||||
│ } │
|
||||
└─────────────────────────────────────────────┘
|
||||
Reference in New Issue
Block a user