Neat! Anyone working on projects to improve the share-ability, code review, version control, or web rendering of Jupyter notebooks, feel free to reach out to me when looking for an enthusiastic early user. Jupyter has been a game changer for my productivity as a data scientist, but I still struggle with something that seems as simple as "what's the best way to expose this to other people easily without having to set up a self-hosted nbviewer".
ReviewNB is very promising! I just wish it could live within Github (my idea is something like how Zenhub reorganizes issues into a Kanban board - add a tab that only allows viewing of ipynb files), since right now I have to kind of cajole people to review notebooks on their site.
Whenever I thought of integrating the review experience in the GitHub UI (via browser extension), I always thought of overwriting the GitHub diff UI. That approach is very hacky and would result in the extension stability issues (any DOM change in GitHub diff could break the extension).
But I just looked at Zenhub and having a separate tab for notebook review could actually work! Since it relies only on the tab related HTML, the extension would be relatively stable. There's still a question of how to post comments etc. But it might be a good start to just offer notebook diff in a separate GitHub tab for pull requests.
There are a bunch of ways that make it _possible_ to do all of this. What's really missing is a way to make it as easy as committing code to Github repo without having to do anything more than install a Github extension.
Right now, I do my work in a notebook, it's automatically converted to a Markdown file (for code review), and I use nbconvert to generate static html, which gets deployed to an internal docs site. I've also been tinkering with ReviewNB, which is trying to make notebook review look like code review, but it's separate from Github and is still fairly unpolished (but very promising!).
Ideally, the experience could be something like:
* Install Github extension that offers a notebook review tab and automatically converts notebooks to a static HTML file that can be served from a url directly accessible from Github
I can think of a bunch of challenges involved in doing something like the above, but my experience working somewhere that offered a tool that allowed me to literally click one button within my notebook and have a shareable url that contained my notebook and the ability to comment line-by-line taught me that this massively unblocks data scientists, who will otherwise end up copy/pasting stuff into documents just to deliver things to partners faster.
Oh my god. I have used Jupyter notebooks for 7 years and never knew this. I just had to fire one up to verify -- and yep; exactly as described. How amazing! Thank you!
No, you should not use output-references in code you share with people, but in my opinion it is one of the main reasons why jupyter notebooks in general put a large emphasis on displaying cell numbers
The numbers track the order that the cells were executed in. So, strictly speaking, you need the numbers to be able to reproduce the output of the notebook's author. However, I think it's bad practice and pretty uncommon to publish a notebook where you need to execute the cells out of order. So most of the time the numbers aren't useful.
It's so it's easy to refer to things, like equation numbers in a maths book, or line numbers in code. E.g. people talking about someone's notebook here on HN can be specific and clear.
Cool, but I would rather use a better supported static site generator with an ipynb plugin (ie, https://github.com/danielfrg/pelican-ipynb) than a tool just for notebooks.
Especially because this looks like an nbconvert workflow under the hood.
> Especially because this looks like an nbconvert workflow under the hood.
It is, however I convert it to the most basic html and add custom css and js to it. So that I can change it to whatever I want. I don't see any problem with that maybe you could point some out.
I didn't go with pelican(or any static gen) because the build times will be much slow later on as blogs increase [1] as this guy faced.
I like to configure a lot of things manually and don't want the burden of static gen if that make sense to you. I just needed a converter.
I didn't find it responsive though. Maybe not your goal but the designs are similar. Similarly I think you can import nbconvert instead of just calling from subprocess.
I browsed the example link given at the GitHub site, and found this blog entry on lessons to tell your younger self. This post is amazing! All the advice rings true.
Worth a read! https://pykancha.github.io/test/2018/cs-phd-lessons.html
Offtopic; does anyone know a tool that can turn a directory of source code into a nicely formatted PDF/PS? So with syntax highlighting etc based on the file you have and chapter index based on directory structure for instance?