Jupyter Github Code Review - github

When doing a code review on jupyter notebooks in github, it shows only the html code that generates the notebook. Are there any extensions that would enable github to show the rendered jupyter notebook, along with the ability to comment on cells for code review?

Under the hood Notebook files are JSON documents. All the markdown, code, outputs are present in this JSON document. Since git diff used by GitHub is meant for text files, it's hard to read Jupyter Notebook diffs on GitHub.
I built a GitHub app ReviewNB specifically to review Jupyter Notebooks on GitHub. It integrates directly with your repositories on GitHub and provides visual diff and commenting support (see screenshot below).
There's also nbdime if you just want to access rendered diff locally.

Related

The notebook I saved to Github from Kaggle comes out as one long line of code instead of formatting. How can I fix this?

I am trying to save my notebook on Kaggle to my GitHub repository. However, when I go to GitHub the notebook isn't formatted and is just a long line of illegible code. Is this because my notebook has markdowns and code? I tried to follow the steps to get it from Kaggle to GitHub but I am not sure what I am doing wrong.
Here is the start of my notebook on kaggle, then what it looks like in my GitHub repository.
Kaggle
Github

How to edit colab notebooks in GitHub directly

It used to be the case that one could easily edit colab notebooks from within GitHub, and also move them (so long as one remembered to change the path in the notebook itself).
Just now I noticed that this functionality in the GitHub browser seems to have been removed. Is this a bug? Is there workaround that does not involve the command line and git?

Install Jupyter Notebook extensions on copy hosted on cloned Github Repository?

I have a cloned Jupyter Notebook hosted on Github. Locally, I have installed Jupyter Notebook extensions but these are not maintained within the Github environment.
Is there a way to install the extensions on the Github server so that cells can be toggled on/off with notebook extensions? Or will I have to go with a Javascript hack as per https://gist.github.com/Zsailer/5d1f4e357c78409dd9a5a4e5c61be552?
It appears this cant' be done as per below:
When you add Jupyter Notebook or IPython Notebook files with a .ipynb extension on GitHub, they will render as static HTML files in your repository.
The interactive features of the notebook, such as custom JavaScript plots, will not work in your repository on GitHub. For an example, see Linking and Interactions.ipynb.
To view your Jupyter notebook with JavaScript content rendered or to share your notebook files with others you can use nbviewer. For an example, see Linking and Interactions.ipynb rendered on nbviewer.
from: https://help.github.com/en/articles/working-with-jupyter-notebook-files-on-github

Latex macros in Jupyter (iPython) notebook not rendered by github

I have a markdown cell in a Jupyter notebook (.ipynb) with the following content.
$\newcommand{\paren}[1]{\left(#1\right)}$
$\paren{\beta^2}$
The file is in a Github repository. The LaTex macro application is not rendered by Github.
Here is how it looks:
The markdown cell, however, is rendered properly when I open is locally as a Jupyter notebook.
Is there a way to make this work? Note that the file is in a private Github repo, so I can not use nbviewer.

Visualizing ipython on github

Is it possible to render a .ipynb file on github the way .md files are rendered? Basically I am asking if it somehow possible to embed the notebook viewer
GitHub supports several formats for README-type files, but IPython notebooks aren't listed among them.
If you are trying to do this with GitHub Pages (static sites hosted on GitHub), manually converting your notebooks to HTML with nbconvert might be useful:
ipython nbconvert --to html --template full notebook.ipynb
This should output an HTML file and a directory containing images and other files.
If you have LaTeX formulas, they should be handled client-side with MathJax.