dartdoc icon indicating copy to clipboard operation
dartdoc copied to clipboard

add option to hide deprecated APIs in web view

Open Luckey-Elijah opened this issue 1 year ago • 4 comments

Example: When browsing pub.dev/documentation/somepackage I would like the ability to "hide" all deprecated APIs as developers would not be needing to read the APIs.

Luckey-Elijah avatar Oct 30 '24 14:10 Luckey-Elijah

Thanks for the suggestion! I would say that, until the API is no longer available, a developer may want to see the deprecated API, so that they can read how to stop using it; what the replacement is; what the old signature is vs what the replacement is; why it is being removed, etc.

srawlins avatar Oct 30 '24 14:10 srawlins

Yes I agree. I think that the ability to view them should be priority. Just for those that know they don't need to see them, it would be nice to hide those unused APIs.

A more specific use case: flutter_riverpod is preparing for a "big version 3 release" so many APIs are marked as deprecated. From a simple document.querySelectorAll('.deprecated').length; query I can see that 69 elements (at the time of this comment) are marked as deprecated. Those entries are valuable to those who need them but can be an "eye sore" or generally unhelpful for those that are not using API deprecated APIs; hence, the idea to toggle hide/showing them.

I currently can use

document.querySelectorAll('.deprecated').forEach(function(el) {
   el.style.display = 'none'; // use null to revert
});

in the browser console to get an idea of how I would want it to look.

Hopefully, this is more helpful for what I had in mind.

Luckey-Elijah avatar Oct 30 '24 18:10 Luckey-Elijah

Ah I see. Yes this would be a cool feature. A little toggle.

srawlins avatar Oct 30 '24 19:10 srawlins

I guess package authors could use the /// @nodoc annotation on all the deprecated items they don't want to show them. But yes, a toggle would be nice.

jonasfj avatar Apr 10 '25 08:04 jonasfj