nbviewer icon indicating copy to clipboard operation
nbviewer copied to clipboard

View as Code gives odd URL

Open dsblank opened this issue 5 years ago • 4 comments

Consider this:

https://nbviewer.jupyter.org/github/comet-ml/comet-examples/blob/master/notebooks/Comet-R-nnet.ipynb

If you click on the "View as Code" button:

Screenshot from 2020-05-14 10-35-35

Then it gives this URL:

https://nbviewer.jupyter.org/github/comet-ml/comet-examples/blob/master/notebooks/script/github/comet-ml/comet-examples/blob/master/notebooks/Comet-R-nnet.ipynb

which is a 404 error.

All of the notebooks in this directory give the same error regardless of the kernel of the notebook (R, Python). I'm not actually sure what is supposed to happen, but that URL looks malformed.

dsblank avatar May 14 '20 14:05 dsblank

@dsblank Thanks for the report. It looks like a recent refactor introduced a path bug for the raw notebook rendering somewhere.

parente avatar May 24 '20 14:05 parente

I get the same error on a Jupyterhub with nbviewer running as a service urls of /services/nbviewer/localfile/jupyter-test/test.ipynb change to /services/nbviewer/localfile/jupyter-test/script/localfile/jupyter-test/test.ipynb and throws a 404

derchrisuk avatar Dec 09 '20 13:12 derchrisuk

I am getting the same error.

abdulvahab avatar May 04 '21 14:05 abdulvahab

It would be great to finally solve it! :) IIUC, the problem sits somewhere here?: https://github.com/jupyter/nbviewer/blob/d9c5da7b1e12e184ce4bd8f9fc152d96aae7baa6/nbviewer/templates/notebook.html#L12

slayoo avatar Jun 11 '22 23:06 slayoo