web-platform-dx / web-features

Exploring how to present Web platform features adoptability
https://web-platform-dx.github.io/web-features/
Apache License 2.0
398 stars 76 forks source link

Integration with spec authoring tools (Bikeshed, ReSpec) #1849

Open tidoust opened 2 months ago

tidoust commented 2 months ago

Raised by @tabatkins during TPAC 2024's breakout on Web features: Bikeshed currently has a mechanism to include MDN panels and Can I Use panels. Down the road, this could be replaced, or completed, with a way to reference web-features, leveraging spec URLs and/or links to BCD keys.

Integration with spec authoring tools seems something worth thinking about from a web-features perspective. Creating this issue to discuss and track progress.

tabatkins commented 2 months ago

Here's how Bikeshed currently integrates with MDN and CanIUse:

MDN

CanIUse


It looks like I can get a nice best-of-both worlds hybrid with web-features. Each feature has both a deep spec link and a unique token.

So my plan, I think, would be:

Aka, something like:

<pre class=metadata>
...
Include Web Features Panels: https://drafts.csswg.org/css-backgrounds
</pre>

<h3 id=background-clip>
Painting Area: the 'background-clip' property</h3>
...
<dl dfn-type-value dfn-for=background-clip>
  <dt><dfn webfeature="css.properties.background-clip.text">text</dfn>

With this, you'd automatically get the css.properties.background-clip feature panels attached to the heading, since it has a matching URL. The background-clip:text features uses the same URL, tho, so this explicitly attaches that panel to the text definition. (If you didn't do this, then because they're both attached to the header, it'll just put both features into the same panel.)