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

Embed images into HTML document #523

Open
cofinoa opened this issue Jun 5, 2024 · 6 comments
Open

Embed images into HTML document #523

cofinoa opened this issue Jun 5, 2024 · 6 comments
Labels
enhancement Proposals to add new capabilities, improve existing ones in the conventions, improve style or format GitHub Usage Improvement to how we use GitHub for this repository

Comments

@cofinoa
Copy link
Contributor

cofinoa commented Jun 5, 2024

Associated pull request

PR #522

The proposed PR #522 modifies the Github action which renders the HTML document of the convention, to embed images into the HTML document, instead of refer images as external file.

This has the advantage of having just one file, for the whole HTML convention document, like the PDF rendered version.

@cofinoa
Copy link
Contributor Author

cofinoa commented Jun 5, 2024

The PR #522 also includes a version update for the GH actions

@JonathanGregory JonathanGregory added enhancement Proposals to add new capabilities, improve existing ones in the conventions, improve style or format GitHub Usage Improvement to how we use GitHub for this repository labels Jun 5, 2024
@JonathanGregory
Copy link
Contributor

Thank you, Antonio @cofinoa. Do you have an example of what the HTML looks like?

@cofinoa
Copy link
Contributor Author

cofinoa commented Jun 5, 2024

@JonathanGregory in PR #522 run checks summary and artifacts has been uploaded to:
https://github.com/cf-convention/cf-conventions/actions/runs/9383208743?pr=522

where you can find an artifact for the conformance document, and the artifact for the PDF and HTML documents.

@JonathanGregory
Copy link
Contributor

JonathanGregory commented Jun 5, 2024

Ah, I see. Each image is included as a string representation of its image data in the src of the img tags. That makes the html file bigger, I suppose, but it is still only half the size of the pdf. Thanks.

@cofinoa
Copy link
Contributor Author

cofinoa commented Jun 5, 2024

Yes!, it makes the HTML file itself bigger.

Also, the image content is BASE64 encoded, adding and overhead between 33%-37% with respect to the original binary data.

But, the good side it's that only on file it's needed for the HTML document. Therefore, it's trade-off

@larsbarring
Copy link
Contributor

The advantage is when one wants to download the html for offline access it is one file (~3.2 Mb), instead of either getting the html file without images (~840 kb), or the html file and an image directory (~840kb + ~1.9 Mb) depending on how the download is done. As it now is, If I uses Firefox to download the HTML link on the webpage I get the former, but if I open the html document in Firefox and then save the the document I get the latter. But I imagine this may differ between web browsers.

Anyway, the size difference is about 1 Mb, which is not excessive, and I think there is merit to always get the full document without having to think of a separate image subdirectory. Thanks Antonio. I will have a look at the PR, but I am far from an expert on gh workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposals to add new capabilities, improve existing ones in the conventions, improve style or format GitHub Usage Improvement to how we use GitHub for this repository
Projects
None yet
Development

No branches or pull requests

3 participants