TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.98k stars 1.18k forks source link

Externally Hosted CSS For HTML Exported Tiddlers #5071

Open bigredrobot opened 3 years ago

bigredrobot commented 3 years ago

Suppose you export a tiddler, about 1 page of text as html to share with a non wiki user with internet access. A single page might be 30kb but 14-18kb of that is just CSS. If you share 5 that is a bunch of extra overhead. Suppose you are using skinny tiddlers and you want for some reason share 100 in a zip, that extra css is starting to add up. I think having the option to point css to a hosted source rather than inline would be helpful. I know I could just cut it out, host it myself and manually modify exported tiddlers but that feels like work.

kookma commented 3 years ago

I think if you are on Node.js + Tiddlywiki you can export tiddlers as static pages and having external CSS to be shipped with exported pages or link to a CDN or a file on the net is simple.

But for people using single html file version, it is good to have a configurable Export specially to .html

rmunn commented 3 years ago

In some compression formats, identical data found in multiple files can be stored (and compressed) just once, and each compressed file would end up containing a reference to the shared data, so in those formats having the CSS duplicated wouldn't cause the compressed file to be larger. But in the ZIP format, each file is compressed separately, so the duplicated data would indeed cause the final ZIP file to be larger than necessary. So I agree that this is a good idea.