Is there any way that I can locally link from one Jupyter notebook to another on GitHub without the need to embed the absolute path, such as https://github.com/jeffheaton/test-linking/blob/main/notebook1.ipynb?
I create a notebook (notebook1.ipynb)
With this content:
# This is Notebook 1
* [Link to Notebook 2a](notebook2.ipynb)
* [Link to Notebook 2b](./notebook2.ipynb))
I tried two different methods, one using the . for current directory. Neither worked.
notebook2.ipynb is actually at this URL:
https://github.com/jeffheaton/test-linking/blob/main/notebook2.ipynb
However, GitHub transforms my link into:
https://notebooks.githubusercontent.com/view/notebook2.ipynb
Which results in a bad link.
If I put this same markdown into README.md it works fine. Just does not seem to like jupyter notebooks.
I would really like to NOT have to prefix everything with https://github.com/jeffheaton/test-linking/blob/main/, because the local links:
Work locally, outside of GitHub
On GitHub are branch agnostic
You can see my attempts to make this work at this short repo: https://github.com/jeffheaton/test-linking
In case anyone happens upon this question. GitHub resolved this issue, relative links now appear to work just fine.
Related
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
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?
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.
Github is not showing the images in my jupyter notebook.
I have tried pushing different formats such as:
![alt text](img/file.png)
and
<img src="img/file.png", width=200, height=200>
which they do work on my local jupyter notebooks in regards of showing images, but once I pushed these notebooks to Github, everything works fine in my repository, but the images won't show.
here is an example
As mentioned in my comment, when something like this happens please ensure that you are uploading the relevant files and that the path you are uploading the files to is still valid relative to the notebook.
I have a very simple notebook, hosted on github and on bitbucket.
The github URL
displays fine in the nbviewer, but the bitbucket URL
- which should indicate the same trivial notebook - does not work with the nbviewer.
Is it possible that nbviewer only takes github notebooks?
Later comment:
my repo was private - so that was at least one reason why it could not work!
Since this is/was the first result when googling for this, I just thought I'd update and let everyone know that this is now an add-on available in Bitbucket. You can find it under Settings -> Find Integrations. The source and issue tracker are available here - https://bitbucket.org/bitbucket/bitbucket-nbviewer
Based on this issue on Bitbucket's issue tracker, it does not seem to be supported yet.
As pointed out by #ThomasK in the comments, you can display a notebook from bitbucket if you copy the raw address.
Just click on the three dots next to your notebook and copy the address that you get when you click on Open raw.
Copy this address...
... and paste it in the text box in https://nbviewer.jupyter.org/ ...
... and it will render your notebook: