Consolidate styles and scripts in Bikeshed-generated standards
Currently there's inline style for syntax highlighting and dfn boxes. And also inline script for service workers and dfn boxes. It seems we should consolidate these somewhat as it's not exactly best practice.
Follow-up to #23.
cc @tabatkins
Bikeshed inlines those styles so that random specs don't magically gain a dependency on some other org's domain.
If you want do do it yourself, tho, that's easy - tell Bikeshed to omit the styles with Boilerplate: style-foo no, (the "style-foo" or "script-foo" key is automatically shown in the first line of the style/script) then put your own styles into your boilerplate.
Could you explain what you mean by the first sentence? (Also, thanks for the advice, that'll help a ton.)
Bikeshed's syntax highlighting, for example, depends on some CSS to work right. If that CSS was hosted somewhere, anywhere, it would make all Bikeshed documents using syntax highlighting depend on that hosting domain. This isn't great. Instead, Bikeshed inlines the styles so the spec is fully functional all by itself. The only external dependencies a Bikeshed document can have are those imposed explicitly by the group's boilerplate.
@sideshowbarker it seems the main missing thing here is MDN annotations. Are we already tracking that somewhere?
it seems the main missing thing here is MDN annotations. Are we already tracking that somewhere?
Well the MDN-annotations patch for Bikeshed hasn’t landed yet—
https://github.com/tabatkins/bikeshed/pull/1564
But as far as I understand, what we’ll end up doing is what’s discussed at https://github.com/tabatkins/bikeshed/pull/1564#issuecomment-564100560
Okay, so it should be all good in the end.
dom.spec.whatwg.org already has MDN annotations as far as I can tell which is why I was asking.
dom.spec.whatwg.org already has MDN annotations as far as I can tell which is why I was asking.
Just the review draft, because I built it with Bikeshed from the https://github.com/tabatkins/bikeshed/pull/1564 branch
whoops, sorry i dropped the ball there. I'll review and merge the pr tomorrow.
Oh wait, I confused MDN and dfn. My bad. The definitions panel is what is causing inline styles and scripts.
Oh wait, I confused MDN and dfn. My bad. The definitions panel is what is causing inline styles and scripts.
OK yeah I think there’s no reason we can’t move the dfn stuff to the external stylesheet and script
I also noticed that https://github.com/whatwg/whatwg.org/commit/4a772bdc9818dfa7d8ea7ea31386adce14bdce0f#diff-1ecbbc7389dd3ea567573f6e14a5fc8c has features that bikeshed's script does not have, such as no-backref. (I was thinking of generalizing/obsoleting that by excluding all backreferences to notes (or at least indicate them differently).)
I have continued to markup things as no-backref, but apparently that stopped working.
If you'd like any specific feature added to Bikeshed's functionality, just file an issue. ^_^
Per IRC discussion Bikeshed has the support we need. We'd have to add omit script-dfn-panel and omit style-dfn-panel to our boilerplate.
Remaining things:
- Should we put the style sheets in standard.css or some kind of new file that's not included by HTML?
- Scripts will have to remain separate. I guess we'd restore resources.whatwg.org/dfn.js with Bikeshed's script.
- Is anyone up for refactoring HTML's dfn usage to allow for more reuse of styles/script from Bikeshed? (A lot of it is for multipage and that cannot be reused.)
- HTML's dfn usage also has some bugs. E.g., the
#workersheader uses a pointer cursor but no panel will spawn. - Should we use an external script for installing the service worker?
Should we put the style sheets in standard.css or some kind of new file that's not included by HTML?
standard.css
Scripts will have to remain separate. I guess we'd restore resources.whatwg.org/dfn.js with Bikeshed's script.
I don't understand this question
Is anyone up for refactoring HTML's dfn usage to allow for more reuse of styles/script from Bikeshed? (A lot of it is for multipage and that cannot be reused.)
I think we should be able to align the styles without much trouble at all. It seems like just changing some class names, plus figuring out if there's any of the HTML-specific style rules we want to port to Bikeshed specs too.
HTML's dfn usage also has some bugs. E.g., the #workers header uses a pointer cursor but no panel will spawn.
Seems like a script problem?
Should we use an external script for installing the service worker?
I don't understand this question.
@domenic Bikeshed currently inserts an inline script. I'd like us to not do that and host our own script. I was also wondering if the service worker script should be external as well as per OP.
The service worker script is already external? Or do you mean the one-liner that installs the service worker?