Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Embed HTML resources using base64
D Shell
Branch: master

readme.md

html-embed

This is a small application to help embedding external resources directly into an HTML page using the base64 encoding.

Syntax:

html-embed input.html output.html [-h/--help] [-t/--tags] [-s/--scripts] [--css]
html-embed input.html output.html --tags=img,audio --scripts=. --css=false

-h / --help - display this

-t / --tags - a comma-separated list of tags to search for content. Their 'src' attribute is read, fetched and is replaced with the appropriate base64 string. Dot to disable. Default - ["img", "audio", "video"]

-s / --scripts - a comma-separated list of script types ('type' attributes), which should get replaced inline. Dot to disable. Default - ["type/javascript"]

--css=true / --css=false - a boolean type. If enabled, all links with a stylesheet relation are fetched and replaced with 'style' tags. Default - true

Notes: The application has many flaws including being quickly written. Non-escaped Unicode characters definitely don't work. I cannot say which websites would work, but github.com and vibed.org do:

html-embed github.com ~/index.html
html-embed vibed.org ~/index.html

That being said, the application is meant for things like reveal.js presentations and not web page cloning.

For working examples see this presentation (it is a standalone html file)

Something went wrong with that request. Please try again.