Add singlehtml_embed_assets option for self-contained singlehtml output - #14661
Open
cyclomati wants to merge 1 commit into
Open
Add singlehtml_embed_assets option for self-contained singlehtml output#14661cyclomati wants to merge 1 commit into
cyclomati wants to merge 1 commit into
Conversation
…file When enabled, the singlehtml builder rewrites the generated page after the build so that local stylesheets, scripts, images, and icons are embedded directly into the HTML file, producing a self-contained single file that can be shared without its accompanying asset files. Local stylesheets become inline <style> elements (with local @import rules and url(...) references embedded as well), local scripts become inline <script> elements, and images and icons are embedded as data: URIs. External (e.g. https://) references are left untouched. The option is off by default, so existing behaviour is unchanged. See sphinx-doc#10688 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013KAcg7m7GR5XMPhw8k3uzC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Adds an opt-in
singlehtml_embed_assetsconfiguration option to the singlehtml builder. When enabled, local CSS and JavaScript are inlined and local images and favicons are converted to data URIs, producing a self-contained HTML file that can be shared or emailed without accompanying asset files. External resources are left unchanged, and the option defaults to disabled to preserve existing behavior. This includes tests, documentation, and a changelog entry. Currently, srcset images and assets referenced by video/object tags are not embedded.References
singlehtmlto embed all assets into a single html file #10688AI Disclosure
Claude Code (Claude Fable 5) was used to write the implementation, tests, and documentation in this PR; the commit carries a Co-Authored-By trailer accordingly. I reviewed the change and wrote this description myself, and the PR is submitted from my account at my direction.