tuxu / ipynb-quicklook

A Quick Look generator for Jupyter/IPython notebooks without further dependencies
MIT License
188 stars 9 forks source link

Doesn't work without internet connection #5

Closed d8xa closed 2 years ago

d8xa commented 4 years ago

I noticed that the extension doesn't work without internet access. Without internet it just shows a blank page.
I'm not well versed in HTML, but it's obvious to me that the template.html file relies on external resources from Cloudflare servers:

https://github.com/tuxu/ipynb-quicklook/blob/c4530175579847e313a80e2da03a67970cc30fd8/ipynb-quicklook/template.html#L5-L8

This seems like a big design flaw, for multiple reasons:

Is there a way to include the files locally? I could be wrong, but theoretically it should be possible to put them in the same directory as the html, and then include them via relative paths. I tried many different pieces of advice I found on various forums on this topic, such as

src='file:///{filename}.' src='../{filename}' src='{filename}' src='assets/{filename},

where {filename} stands for the filename and assets is a folder. But none worked.

My ugly solution: Including the Javascript code inline inside the <script></script>tags. it works, but it's ugly and lack modularity. I'd appreciate any input, even if it's just a hint, how to to it with src attributes.

And even this "solution" leaves me with the problem how to include a local CSS stylesheet. From what I read, it should be possible to do, although I'm afraid this is beyond my rudimentary HTML knowledge. Any help would be greatly appreciated.

Edit: just noticed a browser extension changed all mentions of "Cloudflare" to "Buttflare". Oops...