geoscixyz / geosci-labs

collection of notebook-apps for concepts in applied geophysics
https://geosci.xyz
MIT License
50 stars 34 forks source link

Figures linked to old gpgLabs repos with absolute URL #11

Closed yangdikun closed 5 years ago

yangdikun commented 5 years ago

image

We also need to fix this referencing because eventually gpgLabs will be taken offline.

BTW: is it possible to have relative URL, so we don't care what the package is called.

lheagy commented 5 years ago

Thanks @yangdikun: we could provide a relative url, but then we would need to copy the images over to all of the sub-repositories, so I think for simplicity, we should path them all to geosci-labs. Would you or one of your students be willing to take this on? It should be a find-replace in the notebooks directory

find: https://github.com/geoscixyz/gpgLabs replace: https://github.com/geoscixyz/geosci-labs

yangdikun commented 5 years ago

Actually I just found another solution. Not sure if this option has been discussed. (https://stackoverflow.com/questions/51975699/embedding-image-into-jupyter-notebook-and-exporting-to-html)

First, encode your image as Base64, e.g. by using one of the online enocders. Create a markdown cell and include an tag which uses your Base64 code, e.g.:

We can embed the images as base64 code in the notebook, so the images are saved with notebooks. The good thing is the display of images does not depend on external links.

I just quickly tried it and it worked well.

lheagy commented 5 years ago

Thanks @yangdikun, that is interesting. The thing that I am concerned with is that it likely will become harder to version the images and is less transparent to others who might want to improve an image how they can contribute (if using a url, it is clear where it needs to be updated, but encoding an image is subtle). This repo name should not change, so this should be a one-time fix