-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat(convert/html): inline CSS and JS with convert --one_file --offline #505
Conversation
Hi @Rapsssito, it looks like a very interesting feature! Thanks! Also, could you create tests that ensure that the output html contains inlined content? |
@jeertmans, thanks for the feedback! I will work on the tests. Regarding the implementation, I can set it up as a flag if you want (it is important to note that this new default behavior is not a breaking change). A parameter like --one-file, should also add -cdata_uri=true (which I haven't seen documented except in the FAQ) and this would cause redundancy and possible confusion. Maybe changing -cdata_uri to --one-file would be more beneficial and clearer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments on the test side
This is indeed not part of the documentation, but I plan to document config parameters better with #485, and probably also render them in the documentation.
I was thinking of the following:
Not sure if 3 is the best default behavior, but inlining everything in one HTML is not really a good habit, especially for videos as it creates very large HTML files. What's your opinion? |
for more information, see https://pre-commit.ci
I have implemented your approach. Let me know what you think! |
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Rapsssito, here as some final reviews from me.
Could you also include documented those changes in CHANGELOG.md
?
One in ADDED (about inlining CSS and JS) and one in CHANGED (about deprecating -cdata_uri
in favor to -cone_file
).
After that, I think it's ready to be merged, thanks!
for more information, see https://pre-commit.ci
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
for more information, see https://pre-commit.ci
It should be ready to be merged! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #505 +/- ##
==========================================
+ Coverage 79.27% 79.56% +0.28%
==========================================
Files 23 23
Lines 1940 1962 +22
==========================================
+ Hits 1538 1561 +23
+ Misses 402 401 -1 ☔ View full report in Codecov by Sentry. |
Thanks @Rapsssito! Some deadlinks were found, but this is because @PanoPepino recently changed its website URL, so I will fix that in another PR. Once again, thanks for your great work! |
Description
Currently, the
--offline
parameter forconvert
stores the JS and CSS files in another folder. Inline CSS and JS makes it easy to share presentations by merging everything into a single HTML file. That way, combined with-cdata_uri=true
, you don't need to share anything more than one HTML file.EDIT: Changed
-cdata_uri=true
to--one_file
. Now, the combination of--offline
and--one_file
together pushes the CSS and JS inline.Check List
Check all the applicable boxes: