cocalc icon indicating copy to clipboard operation
cocalc copied to clipboard

generate student version of notebook should preserve images in markdown

Open williamstein opened this issue 11 months ago • 1 comments

  1. Create a notebook with images in markdown, which you copy/paste into the notebook
  2. Click "Generate Student Version".
  3. The images aren't visible.

WORKAROUND: I the notebook is a.ipynb, the images are all in a subdirectory .a.ipynb.upload. Copy that directory into the student/ subdirectory, and then the images will appear and also get distributed. E.g., cp -rv .a.ipynb.upload student/

FIX IDEAS:

  • Generate student version of a.ipynb should also copy .a.ipynb.upload
  • Or, switch to instead placing images on an image server identified by a sha1 hash and then there are no image files; this is what github does -- it's pretty nice in some ways, but is also kind of horrible (e.g., abuse can be very bad, it's hard to "garbage collect", etc., i.e., you have to keep the images forever).
  • Or, embed the images directly in the ipynb file using base64 encoding and the standard image attachment business. Probably this is the best solution since it works outside cocalc.

williamstein avatar Mar 16 '24 20:03 williamstein

I would definitely prefer the last option.

novoselt avatar Mar 17 '24 00:03 novoselt

I can confirm that this is still broken. And this is obviously a huge pain for instructors! Adding P-high, but also easy, since it's not a hard thing to fix. We just need to copy hidden directories to the student subfolder... or put images in a blob store like github and we do in sagews: https://github.com/sagemathinc/cocalc/issues/5895

williamstein avatar Jul 26 '24 19:07 williamstein

I've decided to do #5895 , so this is blocked on that, and will be automatically solved by that.

williamstein avatar Jul 27 '24 19:07 williamstein

fixed via implementing #5895

williamstein avatar Jul 30 '24 23:07 williamstein