-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Highlight deprecated API components in "Table of Contents" #772
Comments
I really like this idea /cc @nodejs/documentation @ilfroloff I think you will want to send a PR against the main repo to this file https://github.com/nodejs/node/blob/master/doc/api_assets/style.css |
👍 |
sounds good, yeah! |
I think graying it out rather than making it red would be better since red catches the eye. |
LGTM |
What about striking through deprecated lines: li.deprecated,
li.deprecated a {
color: #ccc;
text-decoration: line-through;
} |
I think I would like gray. It would be awesome to see some prototypes though |
@evanlucas sure, run this in the chrome devtools at the production docs and it will strikethrough and change the color of all deprecated APIs. var links = Array.from(document.querySelectorAll("#toc li a"))
for(const method of links) { // very hacky
const marker = document.querySelector(method.getAttribute("href"));
if(!marker) continue;
const heading = marker.parentNode.parentNode;
let stability = heading.nextElementSibling;
if(stability.className === "api_metadata") stability = stability.nextElementSibling;
if(stability.className.includes("api_stability_0")) {
method.style.color = "#999";
method.style.textDecoration = "line-through";
}
} |
thanks @benjamingr. So the link becomes a lot less readable on hover would be my only complaint with that. I'm sure we could fix that quite easily though. I think the best think to do here would be to have a pr with one of these on nodejs/node and we can go from there? |
As much as I would find gray more intuitive, too, I’d be worried that the low contrast from graying out entries might not work out as well as striking through for people with visual impairments. But then again I’m also definitely not an expert on that topic. |
I was thinking about a |
@addaleax that's a good point, |
You could make deprecated items grey and add a toogle-button at the top to also strike them through (Or don't show them at all, when button is toggled). |
Created PR nodejs/node#7189 |
Highlight deprecated API methods/properties in "Table of Contents" for increasing understandability. Adapted code to eslint standards. PR-URL: #7189 Fixes: nodejs/nodejs.org#772 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Highlight deprecated API methods/properties in "Table of Contents" for increasing understandability. Adapted code to eslint standards. PR-URL: #7189 Fixes: nodejs/nodejs.org#772 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Highlight deprecated API methods/properties in "Table of Contents" for increasing understandability. Adapted code to eslint standards. PR-URL: #7189 Fixes: nodejs/nodejs.org#772 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Hello All!
I have a proposal of how to increase understanding on which of properties/methods in module API are deprecated. When someone opens module's API page, he/she sees "Table of Contents" and it's not clear which part is deprecated (especially in
util
module).My vision of deprecated parts in "Table of Contents":
CSS for list item:
Thanks!
The text was updated successfully, but these errors were encountered: