-
Notifications
You must be signed in to change notification settings - Fork 488
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
Add "deprecated" banner based on BCD front matter (and fall back to tag) #3929
Comments
Yes to all of the above. It makes sense. This is a better specced duplicate of what I posted in #3818 The things I'd add to this:
|
This plan works for me. A couple of additional notes:
I read this and thought there were three distinct states:
Not sure what should happen in that second state. Feels sort of wrong to use the backup tag in that case, which feels more broken than intentional
I'm not enthusiastic about doing all of this at once (or at least, following the same pattern). I'm skeptical that the data quality for |
I agree with both "sentiments" here. I think we should consider making "deprecated" a value rather than a key.
That way it'll be treated as just another "section" and it'll have a so-called "ingredient" component that knows how to render that. With that out of the way, I think we should NOT inject things into the document that we don't know for certain. E.g. {
"type": "status",
"value": {
"id": "experimental"
}
}, ...should not appear just because the doc happens to have the |
I'll need to sleep on it a bit but I like the idea that we can ask the document, in multiple ways "Are you deprecated?" and it's all the same independent of the usage (e.g. sidebars vs. macro links vs. rendering the doc). |
Thoughts:
|
Yes to ^^^ and @Rumyra summary - in particular support the idea of some kind of combined status. Further thoughts
|
One comment on this bit, that I forgot:
I don't think we should be adding little deprecated icons, or whatever, on links appearing in content. I think we should definitely add banners, and people seem to like the icons in sidebars, so OK, but I think it would look really distracting to add them whenever we link to a page in normal content. |
@wbamberg I see your point re ^^^^ but I think that we would find it better if we were distracted. The reason I suggested this was that
It would be interesting to be able to review what it might look like, or at least to be able to opt-in or opt-out of auto insertion of the icons (perhaps via macro). |
(@peterbe asked me to file this, so here goes :) see also https://github.com/mdn/yari/discussions/2905 and https://github.com/mdn/yari/discussions/2905#discussioncomment-618185 in particular)
At the moment we signal deprecation in various ways:
on the page for the deprecated thing, we have:
Deprecated_Header
macro (e.g.String.prototype.blink
)on links to the deprecated thing, we have:
Deprecated_Inline
macro (e.g. https://github.com/mdn/content/blob/2d7722a59a0c07fde6197f340a845e625faef175/files/en-us/web/api/element/index.html#L406).So that's drawing on three different sources to know whether a thing is deprecated. It would be good to rationalize this. In general I think BCD is better-maintained than tags or the manually added macros. Recently we have started adding the BCD query into front matter and extending Yari to build the compat table and the spec table from that data, if it is present. So why not extend this further, and make Yari generate the "Deprecated" banner based on BCD?
The basic plan looks like:
browser-compat
front matter key.browser-compat
is there, and indicates "deprecated", it adds the "Deprecated" banner.browser-compat
is not there, Yari checks the page tags for "deprecated". If the page is tagged "deprecated", Yari adds the "Deprecated" banner.{{Deprecated_header}}
macro to make it a no-op if thebrowser-compat
front matter is present.{{Deprecated_header}}
macro.This issue is for the first two of these. The third can happen in parallel.
This plan keeps the "deprecated" tag around indefinitely, but only as a backup for pages that don't have BCD but might still want to indicate deprecation.
@hamishwillee , @ddbeck , @Elchi3 , @Rumyra, @teoli2003 you might be interested in this or even better you might see fatal problems with it!
See also:
The text was updated successfully, but these errors were encountered: