HTML export too large: disable offline HTML support? #3526
|
I produce quite a few Pluto notebooks which are exported as HTML files. After upgrading Pluto, the size of each notebook file jumped from ~50KB to ~8MB. This is as expected, described here. However, ~8MB is totally unacceptable for my use case. Is it possible to export leaner HTML files by default? |
Replies: 4 comments 3 replies
|
The large file is coming from In the current code, The UI export link currently asks for: notebookexport_url={this.export_url("notebookexport", { offline_bundle: "true" })}so the normal browser export path is intentionally using the offline bundle. Workarounds:
That produces a smaller HTML file that depends on CDN-hosted Pluto frontend assets, so it is no longer a fully offline/self-contained export. |
|
Thanks for the workarounds! Follow up question: Do you think it's worth me making a PR to add a checkbox in the export UI? Or does @fonsp have other plans?
|
|
Can you write a bit more about your use case? What makes the 8MB unacceptable? |
|
I think the Checkbox you suggested makes sense! It should be checked by default and sound like an positive/attractive option, like "Offline-ready", with a "help" button to explain the difference. And the design should be a bit more sleek than in the screenshot. The design goal is to make sure that most people use this, to benefit from the reproducibility of the feature. Users with specific requirements (like you mentioned) can then download the web version instead, but it should not be the default. |

The large file is coming from
offline_bundle=true.In the current code,
Pluto.generate_html(...; offline_bundle=false)is the default. Whenoffline_bundle=true, Pluto uses thefrontend-dist-offlinebundle and inlines assets as data URLs, which is exactly the behavior that makes the export self-contained and much larger.The UI export link currently asks for:
so the normal browser export path is intentionally using the offline bundle.
Workarounds:
Pluto.generate_html(notebook; offline_bundle=false)if you are exporting from Julia code./notebookexport…