3

I have developed interactive application in python using jupyter notebook with ipywidgets and use voila to run the notebook. On my development system (with internet) I have the application working flawlessly. But on the system without internet the application does not load. On inspection with developer tools, the web application is trying to load scripts from mathjax, font-awesome and here

If anyone could guide me on how to workaround this problem ? Run jupyter notebook application with ipywidgets without internet. Can we change some settings / configuration to use the static copy of these dependencies?

---- Update On the system without internet, running jupyter lab and notebook and running the cells works perfectly fine. I am able to view the font-awesome icons and other ipywidgets. This issue is observed only using voila

Thanks in advance for your help.

  • 1
    One suggestion would be to summarize this and link to this post on the [Jupyter Discourse Forum](https://discourse.jupyter.org/) in the hopes of getting more eyes to see this. There's been talk, more about in the JupyterLite context, about making things work better offline ultimately and so maybe someone knows a better path than any clunky workaround I could suggest looking into. – Wayne Apr 09 '22 at 17:36
  • 1
    Thank you @Wayne I have added a [post](https://discourse.jupyter.org/t/running-voila-without-internet/13823) at the Jupyter Discourse Forum. – Ganesh Kumar M R Apr 10 '22 at 13:56

3 Answers3

2

Looks like we need to override the references to cdn and fontawesome in the templates of voila with local references. Please find the reply from Jupyter discourse forum here.

0

I had the same issue about "font-awesome" icons which is not working with voila. To workaround it, I'm now using unicode characters in description strings instead of icon property.

0

voila still requires some scripts from internet as of March 2023.

I tried to fix it by customizing templates but I was not able to do it for MathJax. I worked it around by replacing internet URLs with local ones with nginx and I am sharing my config as it could be useful to someone else.

  sub_filter_types text/html text/css application/javascript;
  sub_filter 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-MML-AM_CHTML-full,Safe' '/vendor/mathjax-2.7.7-TeX-MML-AM_CHTML-full.Safe.js';
  sub_filter 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS_CHTML-full,Safe' '/vendor/mathjax-2.7.7-TeX-AMS_CHTML-full,Safe.js';
  sub_filter '[MathJax]/extensions/MathMenu.js' '/vendor/MathMenu-2.7.7.js';
  sub_filter '[MathJax]/extensions/MathZoom.js' '/vendor/MathZoom-2.7.7.js';
  sub_filter 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@^5/css/all.min.css' '/vendor/fontawesome.min.css';
  sub_filter 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@^5/css/v4-shims.min.css' '/vendor/fontawesome-v4-shims.min.css';
  sub_filter_once on;
Sourcerer
  • 1,786
  • 2
  • 13
  • 18