Skip to content
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

Auto-add deprecation marker for API item if known #3818

Closed
hamishwillee opened this issue May 18, 2021 · 3 comments
Closed

Auto-add deprecation marker for API item if known #3818

hamishwillee opened this issue May 18, 2021 · 3 comments
Labels
🐌 idle Issues and PRs without recent activity. Flagged for maintainer follow-up.

Comments

@hamishwillee
Copy link
Contributor

hamishwillee commented May 18, 2021

As part of mdn/content#5075 I added the tag "Deprecated" to GlobalEventHandlers.onkeypress, which automatically added the deprecated icon to the sidebar:
image
Nice :-)

Would be good if this was also added to links in the text like this:
image

Obviously this would be great for any kind of link, but in particular for macro generated links. Bonus points to also add experimental icons etc.

Note, this would probably require some fixes to the cases where the tagging has been added explicitly via `{{deprecated_inline}}. I realise this might be controversial, but to me the information about status really should be documented in the thing that is being referred to, and propagate everywhere. I'd also argue this should be separate from tags, but that's another story.

Further, it is a problem for me that we mark deprecation, non-standard, etc in three places: deprecation header, tags, BCD. This should all come from the BCD if present, and otherwise be over-ridden by a tag. The tag should auto-generate the deprecation header (or BCD should if that was what was used).

@peterbe
Copy link
Contributor

peterbe commented May 18, 2021

Drive-by comment; when we check for broken links we always look it up. We don't just check if the file exists (in the predictable folder name). So it wouldn't be inconceivable to read in the tags and based on that mutate the link. E.g.

const identifier = '/en-US/docs/API/Web/Window/onkeypress'
const doc = getPage(identifier);
if (doc) {
  // Not broken, but should we annotate the link???
  if (doc.tags.includes("Deprecated")) {
    text += " (deprecated!)"
  }
  ...
} else {
  logBrokenLinkFlaw(identifier)
}

Where and what KS macro is that?

@hamishwillee
Copy link
Contributor Author

@peterbe That ^^^^ sounds like a good idea.

  • We'd probably want to also check for experimental and standard track in BCD (and whatever the equivalent tags are on MDN)
  • These things also get a bit messy if you decide you want to auto-add a deprecation header to a page based on BCD or tags - because say you have a page tagged with both experimental and deprecated you probably only want the deprecated header (it kind of supersedes the others).

Where and what KS macro is that?

Now I look at the source the link I was talking about was a plain link and not a macro at all. Doesn't change my answer - any xref macro or link to a topic (note, I did not say "reference topic" here. If the page is marked as deprecated then it probably makes sense to mark it as deprecated when linked even if it is not a reference topic).

@github-actions github-actions bot added the 🐌 idle Issues and PRs without recent activity. Flagged for maintainer follow-up. label Dec 8, 2021
@caugner
Copy link
Contributor

caugner commented Nov 15, 2022

Closing in favor of duplicate #3929.

@caugner caugner closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐌 idle Issues and PRs without recent activity. Flagged for maintainer follow-up.
Projects
Development

No branches or pull requests

4 participants