Open cderv opened 2 years ago
This is important to us. @cpsievert Would you like a pull request?
I think it makes sense to support arbitrary attributes on stylesheets.
A PR would be great. In case it's helpful, this is the initial PR for <script>
#188 (see also #201).
We'll probably also need something similar to https://github.com/rstudio/shiny/pull/3395 in order to dynamically render the stylesheet attributes correctly
Yes, supporting arbitrary attributes will be even better!
@cderv Would you want to work on it? This is not urgent though since you have already had a workaround.
Yes I'll add that in the list. thanks !
Currently
htmlDependency()
allows to passintegrity
SRI or any other attributes toscript
.I wonder in continuation of https://github.com/rstudio/htmltools/issues/101 if we could add same logic for
stylesheet
.This would allow
renderDependencies()
to generate a HTML with more thanhttps://github.com/rstudio/htmltools/blob/e47232123e8916bf7c8d95f4513d0fa77c8f4d13/R/html_dependency.R#L502-L509
For example, I believe this would also allow to include HTML dependencies in R Markdown document output while adding
data-external = 1
to indicated Pandoc should skip the link inself-contained
operation. Currently, I don't think we can do it. This is the use case I have - I was just surprised it was not working the same as I can't add more attributes to the<link>
tag and wondered why. 🤔What about adding the same logic for stylesheets and scripts ?