2023/07/26#p1
I found code-input – a simple textarea overlay that works with prism.js – so now have syntax highlighting:

A few more tweaks and it's done.
2023/07/26#p2
One of the changes I wanted to make to the file editor was to use all locally hosted files rather than from a CDN. Strangely, it works with all except for one. No matter what I do the whole thing breaks if I try to use a local copy and I don't know why.
Update Sorted! I was trying to do it on my phone so didn't have the benefit of viewing the browser console. Checking on my Mac indicated it was looking for other files which I didn't have locally.
2023/07/26#p3
I think the file editor is done. I've sorted a couple of issues and added some new features:
- proper nesting & indenting of subfolders
- folders listed before files rather than purely alphabetical
- detection of file type based on extension which loads the corresponding highlighting template
- open a file for editing immediately after creating it rather than have to select it manually in a separate step
- fixed an issue with the generated textarea overlay being slightly the wrong size (32px too narrow and 16px too long 🤷♂️)
The only thing left to add (should I be so inclined) is file uploads.
It's one of those projects that started life as a silly idea 1 but has turned into something with genuine utility.
-
inspired by a site building framework, I can't remember which, that mentioned full "in browser editing" ↩