Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of embed mode #58

Open
sebastienbeau opened this issue Jan 18, 2015 · 3 comments
Open

Support of embed mode #58

sebastienbeau opened this issue Jan 18, 2015 · 3 comments

Comments

@sebastienbeau
Copy link

Hi,
First of all thanks a lot for hovercraft, it's a really great tool!
I was using landslide before and I want to move on hovercraft. For some special reason I need to have the support of embed mode like in landslide in order to produce a only one html page with everythink inside (css, html, image...).

I would like to know If you will be interested to integrate this option If we do a PR ?

We can use the same args as landslide :

-i, --embed Embed stylesheet and javascript contents,
base64-encoded images in presentation to make a
standalone document

What do you think?
Thanks a lot for hovercraft I really enjoy it ;)

@regebro
Copy link
Owner

regebro commented Jan 19, 2015

Yeah, why not? :-) Can you explain more on how you would do it?

@frederikmoellers
Copy link

frederikmoellers commented Apr 13, 2017

I think this would be quite handy, though it will definitely have limits.
What you can do: Whenever hovercraft encounters an external resource (an image, a CSS file or a JavaScript file), instead of inserting a reference to this file into the HTML document, it would paste the file contents (base64-encoded in the case of images).
What you can't do: If JavaScript loads external resources dynamically, you can't handle this. As an example, MathJax only needs a single JavaScript file to be included in the HTML document, but it will load all CSS and fonts dynamically when being loaded. As hovercraft can't know what will be loaded at runtime (I think this also depends on the locale and other things), it cannot include all necessary files in the HTML page.
I believe the Chrome extension SingleFile tries to do the same, though I haven't tried it.

@regebro
Copy link
Owner

regebro commented Apr 13, 2017

Yeah, it's really two things here, one making it into one file, thereby making it easier to upload or send by email, and the other is making sure that it works even when you don't have internet.

Of course, unless you yourself directly loads resources online, there was no case of loading things from the internet before I merged the Mathjax functionality. I'll see if I can make offline Mathjax support, because then we don't have to care about that issue.

@regebro regebro closed this as completed Apr 13, 2017
@regebro regebro reopened this Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants