4 ms·
I've been playing with passing markdown+css file+image tree to: pandoc {options} -H file.css --self-contained. It base64 encodes the images directly into the H
by akeck 10y ago
I've been playing with passing markdown+css file+image tree to: pandoc {options} -H file.css --self-contained. It base64 encodes the images directly into the HTML5. The css in file.css is wrapped in <style></style> and is inlined in the header. The result is a fat HTML file with all the basic bits to make an article included. Exact line: pandoc --standalone --toc -V "toctitle:'Title'" --self-contained --to html5 -H article.css -o file.html file.markdown. Image links in code: \ <-- escaped space to force inline image.
- wodenokoto 10y agoFor the longest time (5 or 6 years, way longer than Electron) I have been puzzled as to why there didn't exist a document format for offline websites/apps, that are basically a zip file of HTML+CSS+images+javascript. That way you could build simple, easily distributable multimedia documents and web apps.
- akeck 10y agoThe pandoc help section on "--self-contained" indicates that it can mostly handle your use case (minus the compression step).
- ktta 10y agoThis is close, but I'm thinking cut out the web tools part. Do we really have to depend on HTML and CSS (or other XML based format which needs a web browser to view) to make and edit a simple word document? I cringe thinking of the bloat that is introduced when using CSS and javascript to view text+pictures.
- zo1 10y agoI haven't used it in a while, but most browsers allow you to go File->Save, and it'll save everything in a contained folder structure that should be easily zippable. Including all linked images/CSS/JS, with their references fixed for local-consumption. That is, until requireJS/AMD/angular/react/backbone/etc and those sorts of things started polluting the web. Thanks you JS developers.
- TuringTest 10y agoIIRC Mozilla created such file format, and MS Explorer has its own proprietary version. They didn't caught on, though.
- TuringTest 10y agoIIRC Mozilla created such file format, and MS Explorer has its own proprietary version. They didn't caught on, though.
- criddell 10y agoIsn't that basically Microsoft's compiled html (chm) files?
- Bjartr 10y agoMHTML is an archive file of a webpage and its external resources.
- ktta 10y agoThanks for the reply. I could really see making great looking documents with this. Although the problem is we're using all these cli tools (I love them too) to edit them. So the problem is when I try to edit them on a new computer or even online, there's no way for me to do it in most cases, and in when I actually can install packages for all that, there's some dependency management I have to do. One more thing, since the output in HTML file, I have to again use a full-featured(which means slow to open) web browser to render the HTML file.
- akeck 10y agoI hear you on needing piles of CLI packages. Regarding the web browser, the pandoc HTML seems pretty basic, so even the lightweight GUI browsers will probably handle it correctly. Also, if you include the correct bits in each image link in the markdown, I believe the resulting HTML5 will render with your included image descriptions in a text-only browser.
- ktta 10y agoHere[1] is the HTML 5 standard. It includes a lot of things that a word file would never need. You're correct about not needing a lot of the things that say a browser like chrome has. Can we still not achieve the same thing with something simpler? [1]:https://www.w3.org/TR/html5/ https://www.w3.org/TR/html5/