8000 Allow embedding of external resources when Respec saves a document · Issue #4971 · speced/respec · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow embedding of external resources when Respec saves a document #4971

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

Open
TimvdLippe opened this issue May 30, 2025 · 0 comments
Open

Allow embedding of external resources when Respec saves a document #4971

TimvdLippe opened this issue May 30, 2025 · 0 comments

Comments

@TimvdLippe
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
We want to publish self-contained releases of our standard documents. Currently, we save the documents and all HTML is "baked in". However, the HTML still has references to external resources, most notably stylesheets. Sometimes we update our stylesheets to add more functionality, for example dark mode. Adding dark mode functionality has sometimes "broken" (debatable and subjective) older documents which weren't expected to be dark mode compatibility. This can lead to contrast and other accessibility issues for older releases of our documents.

Describe the solution you'd like
We would like to, when Respec saves a document, to also allow us to say "for these external resources, make an embedded copy into this document". Sort of to say "take the current released version and start using the local copy, removing the external reference". At that point, even if the external resources is later updated, since the saved document uses a local copy, the document structure remains in tact.

Take the following HTML as example:

<link href="https://gitdocumentatie.logius.nl/publicatie/respec/styles/adr-style.css" rel="stylesheet" type="text/css"/>
<link href="https://gitdocumentatie.logius.nl/publicatie/respec/styles/adr-dark.css" rel="stylesheet" type="text/css" media="(prefers-color-scheme: dark)">

Here, we use a single stylesheet for several of our documents (similar to the W3C base stylesheet). We would like these to be embedded at the time of creation. Example solution using an attribute:

<link class="embed" href="..url.." rel="stylesheet" type="text/css"/>
<link class="embed" href="..url.." rel="stylesheet" type="text/css" media="(prefers-color-scheme: dark)">

The embed class is similar to the remove class, but rather than removing it from the document it would save a local copy. The eventual HTML after saving the document would become:

<link href="./media/adr-style.css" rel="stylesheet" type="text/css"/>
<link href="./media/adr-dark.css" rel="stylesheet" type="text/css" media="(prefers-color-scheme: dark)">

Additional context
Ideally we would do this for the W3C base styling as well, but I would first make this user opt-in for resources in their own documents rather than in Respec itself.

Describe any alternatives you've considered
We can copy all external resources to the local repository and only use local references. However, that gets unwieldy quite quickly if you have a couple of documents that all refer to the same resource. That makes updating and keeping them all in sync difficult and (in our opinion) unmaintainable.

Can you or your organization fund the work or help with development?
Yes we already maintain a fork of Respec and can both implement plus upstream the work. I haven't implemented in our fork yet, as this is a slightly bigger feature that I would like the wider Respec community to comment on first.

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

1 participant
0