I love OpenGist.
Github's original idea of Gists is brilliant. It's your old pastebin but on steroids, with Git support, versioning etc.
But I've always felt uncomfortable with storing my scripts, shared snippets etc. on a centralized platform owned by Microsoft that already has access to more than 90% of the source code ever written by humanity.
OpenGist fills exactly that gap. It allows you to run your own private Gist clone on your own infrastructure, either because you want to share private snippets with your friends or colleagues without fears of leaking credentials or tokens on someone else's public cloud, or just because you want to have control over your own data.
And I love Jupyter notebooks.
They are the best tool we have for reproducible science and for sharing code and data.
The main problem with Jupyter notebooks however is that, even though they were meant to be shared across researchers and engineers, there's no easy native way of doing so.
Sure, you can just send the .ipynb
file to someone and they can open it in their own Jupyter server. But that assumes that the other person has both a running Jupyter instance and a configuration of its kernel that is compatible with the one you used to generate your notebook.
Sure, you can bypass the limitations imposed by the Jupyter server and bind it to a non-local interface, then share the link and the token with your friends. But that poses the same security risks that you'd have whenever you share over the Web an interface to run direct Python code on one of your machines.
Otherwise, you can upload them to gist.github.com
, or nbviewer
, but that again would put your precious work in the hands of an external cloud provider.
Or you can host nbviewer
yourself, but that'd be just another service to run (why would I want that if I already have an OpenGist instance?). Plus, nbviewer
doesn't really "store" your notebook. You'll still need to host your notebook on some other permanent URL anyway, and then pass that to nbviewer
. It's not like the Gist approach where you have your own "profile page" that others can browse to explore your work and render it on the fly.
So why not have native support for .ipynb
directly baked in OpenGist, just like Github does?
That's a question that another user asked already in November 2024, but for some reason didn't get an official response from the maintainers.
So I've decided to take the matter into my own hands in these days and submit a PR.
You can check out the results yourself through a test notebook uploaded on my server, and compare that to the same notebook hosted on Github.
Features:
- [x] Entirely implemented on the frontend (similar to what Github does), so it doesn't mess up with the existing ways that OpenGist manages files on top of the git abstraction.
- [x] Code highlight (but I need more testing to ensure that it works fine also with non-Python extensions).
- [x] Markdown support (through
showdown
). - [x] LaTeX support (through
katex
).
(Still) missing features:
- [ ] Support for file uploads - this is unrelated to this specific feature though, and it should be implemented on OpenGist itself. Copy-pasting big JSON blobs in textareas feels a bit clunky.
While the PR is pending review you can start toying with OpenGist with Jupyter support by using my branch:
git clone https://github.com/blacklight/opengist.git
cd opengist
git checkout 390/ipynb-support
make
./opengist
Or, if you want to run it in Docker:
docker build -t opengist .
Happy gisting!