Open nigelmegitt opened 11 months ago
We probably need some kind of new template syntax for that. This feels very much like something a custom element should handle.
we might want to check if we do this in some other way already
I was hoping {{ variable }}
would be available, a la nunjucks templating but I see that has been taken for WebIDL linking. Maybe {$ variable $}
would work instead?
One thing we should consider is how complex the expressions within that are allowed to be, and if there are any injection risks: where I just wrote variable
above, I guess it could be upper(variable)
or some other expression that's even more complex.
Is your feature request related to a problem? Please describe. I'd really like to be able to include a link to the document's GitHub repo in the document itself, not just in the header. This information is already part of the Respec config, so I would like to be able to re-use it rather than duplicate it. I found a way to insert Respec config using a post processing script, but it feels as though there ought to be a better way.
I'd generalise this to any Respec config value, not just the repo URL.
Describe the solution you'd like I'd like to be able to include some kind of macro, maybe nunjucks-style, that inserts values from javascript into the HTML document using a common syntax in the HTML itself.
Additional context
The reason I'm inserting a link to the GitHub repo in this case is because I want to put it into the Registry Definition instructions for requesting a change to an inline Registry Table, and those instructions include "raise an issue on the repo", effectively.
See also spec-prod email thread at https://lists.w3.org/Archives/Public/spec-prod/2023OctDec/0003.html
Describe any alternatives you've considered Hack that I consider ugly, to do this now, at https://github.com/w3c/dapt/blob/72dae1c652b6ce5e74a7fe4fcc19b49dfaf86fb9/index.html#L8-12 - I then add a specific class value to all the
<a>
elements whosehref
attribute I want to replace, and reference this function in thepostProcess
array in the Respec config.Can you or your organization fund the work or help with development? ReSpec is a community maintained project, meaning it doesn't have any dedicated staff or funding.
There are three options to get your feature implemented. You can: