voila-dashboards / voila

Voilà turns Jupyter notebooks into standalone web applications
https://voila.readthedocs.io
Other
5.39k stars 501 forks source link

Offline voila + font-awesome stylesheet #539

Open jeffyjefflabs opened 4 years ago

jeffyjefflabs commented 4 years ago

My organization uses Voila on a corporate network without internet access. The default template links to unpkg.com for the font-awesome stylesheet. We can't get to that, so we're missing icons and things. For example, if you turn off internet then ipywidgets.Button(icon='search', description='hello') will have a placeholder/error icon in Voila instead the normal magnifying glass.

We can patch the template to point at the copy provided by notebook (for anyone in a similar situation: {{resources.base_url}}static/components/font-awesome/css/font-awesome.min.css), but that only works for the server extension, not the standalone app. Is it possible to bundle the stylesheet with Voila? (Worst case, we could host it somewhere on our network, but we'd prefer to avoid patching the template.)

rjplatt commented 4 years ago

It would be great to see this remediated, and possibly a mechanism to block any external resource access (perhaps block-all-mixed-content policy?)

jeffyjefflabs commented 3 years ago

I happened to notice https://github.com/jupyter-widgets/ipywidgets/issues/2997 so just wanted to link the tickets together. I don't know if this is better addressed here or in ipywidgets or elsewhere.

As an update to my original post, we've tried a few of the other templates out there, and so far only the built-in lab/classic templates and voila-material work reasonably well offline. The vuetify and gridstack templates both load lots of external stuff so are basically unusable offline. One of the workarounds we're looking at is maintaining an "offline" version of the template. For the built-in lab template, this was pretty straightforward with jinja's inheritance mechanism, and it seems like it should be much less fragile than the diff/patch we're doing now! I haven't looked at doing that for the other templates yet, but we've got some notebooks using the old jupyter dashboards extension so we're definitely interested in the gridstack template.

trungleduc commented 1 year ago

I'm removing this issue from the 0.5.0 milestone as discussed in https://github.com/voila-dashboards/voila/issues/1245#issuecomment-1658346305