n1az78 downloadsDisplay JSON data as collapsible trees in your notes.
Display JSON data as beautiful, interactive collapsible trees in your Obsidian notes.
Download the plugin files
main.js (required)manifest.json (required)style.css (optional - can be empty, styles are embedded in main.js)Locate your Obsidian vault
Create the plugin folder
.obsidian/plugins/ (create the plugins folder if it doesn't exist)json-collapsibleCopy the plugin files
json-collapsible foldermain.js and manifest.jsonYourVault/
└── .obsidian/
└── plugins/
└── json-collapsible/
├── main.js
├── manifest.json
└── style.css (optional)
Enable the plugin
Once installed, you can display JSON data in your notes using JSON code blocks:
```json
{
"name": "John Doe",
"age": 30,
"email": "[email protected]"
}
```
```json
{
"users": [
{
"id": 1,
"name": "Alice",
"active": true,
"roles": ["admin", "user"]
},
{
"id": 2,
"name": "Bob",
"active": false,
"roles": ["user"]
}
],
"metadata": {
"total": 2,
"page": 1,
"lastUpdated": "2024-01-01"
}
}
```
main.js and manifest.json) are in the correct folderjson-collapsiblejson language identifierIf you see an "Invalid JSON" message, your JSON syntax has an error. Common issues:
If you encounter any issues or have suggestions:
This project is open source and available under the MIT License.
To build or modify the plugin:
main.js - Main plugin code and embedded stylesmanifest.json - Plugin metadatastyle.css - Optional (currently unused, styles are in main.js)json-collapsible/ to your vault's .obsidian/plugins/json-collapsible/ folder for testingNote: This plugin embeds styles directly in main.js using the addStyles() method, so style.css is not currently used.
Enjoy visualizing your JSON data in Obsidian! 🎉