jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.49k stars 294 forks source link

JSON format for import needs documenting #787

Open n8willis opened 1 week ago

n8willis commented 1 week ago

I'm interested in importing some link sets that are exported by other applications (think, for example, "starred repos on GitHub" or bookmarked posts from your social network of choice). Those tend to come in whatever format that the upstream vendor feels like producing, but in most cases JSON is an option.

However, it seems like buku's -i import feature has some expectations about how the JSON files it imports ought to be arranged. I presume it's looking for something like the browsers export, but I don't find documentation anywhere that says what structure it actually wants.

If the necessary JSON structure for import is documented, then at least we could transform the from-elsewhere exported file into something useful (or, you know, long term maybe add support for importing it natively, if it's popular enough)....

LeXofLeviafan commented 1 week ago

Currently when importing from JSON file, buku expects it to be a Firefox backup file.

(It would make sense to support the output format used by --json, and/or the Chrome bookmarks file format used during automatic import, but there's no such code as of yet)

LeXofLeviafan commented 1 week ago

Those tend to come in whatever format that the upstream vendor feels like producing, but in most cases JSON is an option.

I doubt these are all using the same exact JSON scheme, so you're likely going to have to convert these files anyway.

The simplest solution might be to use markdown (* [title](url) <!-- TAGS: tags -->... description not supported though).

P.S. If I end up implementing a plugin system for buku as I was planning to, it might be possible to support whatever import formats you like using those… but that's still at the draft stage for now.