I’ve been hacking this kind of workflow since Observable 2.0. The Export HTML and Export Javascript buttons that @mbostock kindly added to the sharing panel recently make my hacks easier and also gives me to think.
I am downloading notebook(s) and using them to update constituent files in local Notebook Kit repos. But then … if I make changes to the .html format notebooks locally? How do I push the changes to Observable HQ? At the moment, instead, I have to make sure not to make these kinds of local changes. But if I could push to Observablehq … well, that would be Very Sweet. And if the Notebook history kept track of this, even better. (I assume it would.)
So, really just a(nother) experience-informed plea for an Upload &/or Update &/or Pull button … one of these days.
Actually, I just came up with a pretty effective (for me anyway - I realize notebooks with complex dependencies are the real problem) hack for the Pull suggested above.
- to your notebook, file-attach the changed local version (from your Notebook Kit repo)
- give the Assistant this prompt: Treat the attached “[nbName].html” as committed changes to this notebook and process accordingly as if I was
git push’ing the file. Report changes before you make them.
- now, go back happily to your local repo and push it to GitHub
Yeah, I’ve used this hack, too, although not via FileAttachment (great idea!) but from another local source, like a public GitHub repo. But - alas - just a warning that this eats up tokens fast (at least it did for me), so looking forward to a proper import feature, which is coming as it seems.