News for hackers. Stuff that matters.
Re:Storing knowledge in a single long plain text file by kjksf on Tuesday May 21, 2024 @05:34PM (#40434270)
Chrome implements APIs that allow accessing files on the disk.

So Edna either stores notes in localStorage or in a directory of your choosing on disk.

In Edna you can right-click for context menu to switch between localStorage and disk.

If you ask: "how do the browser APIs work", you can look at https://github.com/kjk/edna/blob/main/src/fileutil.js

Basically, there's `window.showDirectoryPicker()` to ask user for permission to access directory (either read only or read write). And then using that directory handle you can read list of files, read / write files or create new files.

Re:Storing knowledge in a single long plain text file by wernsey on Wednesday May 22, 2024 @04:05AM (#40438489)
Oh, man, many years ago I used Tiddlywiki (and later Wiki-On-A-Stick) as a browser-based note taking app, but stopped using it because the API they used to save the file to disk got deprecated and removed.

History not repeating but rhyming, I suppose...

Anyway, thanks for this. I've just added it to my bookmarks.