obsidianmd / jsoncanvas

An open file format for infinite canvas data.
https://jsoncanvas.org
MIT License
2.48k stars 82 forks source link

Proposal: canvasz — a zipped canvas file, which packages a the markdown files along with it #38

Open CheeksTheGeek opened 5 months ago

CheeksTheGeek commented 5 months ago

Right now, the main difference between other file formats comparable to JSON Canvas is that JSON Canvas or some other superset/abstraction of JSON Canvas isn't self-sufficient yet, meaning if I have a lot of markdown files referred-to inside my canvas file, and my Obsidian Vault or setup inside one of the other apps enabled with JSON Canvas import/export capability is not managed well, the JSON Canvas file is going to end up mostly unusable due to non-existent or unreachable file links.

Hence, I propose having another layer of abstraction over JSON Canvas, called JSON Canvas Zipped, and the file extension for which would be .canvasz, and when unzipped, would have this directory structure present inside:

unzipped_canvasz_file_dir/
├── index.canvas
├── file1.md
├── file2.md
└── file3.md

If Obsidian or other software with complete Canvas import/export implementations choose to export, the user could be offered the ability to export as either. When importing, the offer would be to choose between a plain text JSON-based canvas file, or the packaged canvasz file. If the user chooses the latter, the import implementation component would track down each file from the internal setup, and package it in the given structure for the user to use it anywhere.

This proposal is an effort towards making the JSON Canvas file or at least an abstraction over it to be self-sufficient in the data it refers to internally.

— chaitanya

CheeksTheGeek commented 5 months ago

Also, just to make it easy to read, .canvaz might be a good file extension name too

jessmartin commented 5 months ago

I love this idea. The ability to include referenced images, PDFs, and other files would be nice as well.

TLDraw handles this by base64-encoding images when exporting, which keeps the image within a single file without the need for a folder or a zipped file. But that serves a different purpose (pass around a single file) than what you have here. Your solution is really nice in that it makes it easy for a human author at the file system to get at the underlying markdown and other files and work with them directly.