-
Notifications
You must be signed in to change notification settings - Fork 125
Hide implementation of static constants #2657
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
Comments
Do you have evidence that developers are copy/pasting from dartdoc rather than from the source (like clicking through in their IDE)? Can the constructor be made private or |
So the first line for a constant would be something like |
@srawlins I've lost count but it happens fairly regularly (e.g. flutter/flutter#83208). The @jcollins-g that would be a slight improvement, but ideally I'd like to completely hide the constants' implentation from the API docs. |
Another way to implement this is as a dartdoc tag. Something like |
That would be ideal! |
This page turns out to have a lot of traffic in the Flutter docs, so finding a way to reduce misinterpretations here would have a high impact. |
Hey, wondering if adding this tag is something I could do? How would I go about that? |
sorry to ask, but "any updates?" |
Sorry, no updates. |
Thanks @jcollins-g! I wonder though, since we now rely on the single |
You shouldn't need thousands of annotations, you should only need a single annotation for the class containing the constants in question. |
You're right, I don't know where I got that idea (: |
…c pages (#128442) This updates dartdoc to 6.3.0. Release notes are available, here: https://github.com/dart-lang/dartdoc/releases/tag/v6.3.0 Most important for Flutter are the reduction in the size of generated HTML files (dart-lang/dartdoc#3384) and a new dartdoc directive to hide constant implementations from indicated classes (dart-lang/dartdoc#3398), which fixes the longstanding issue (dart-lang/dartdoc#2657). I've also added the api documentation zip to `.gitignore` and the `{@hideConstantImplementations}` dartdoc directive to the motivating example. A screenshot:  I assert that this change to icons.dart should be test-exempt as existing tests cover whether or not dartdoc directives are recognized or are leaking into HTML, and the impact of adding the directive was tested in dart-lang/dartdoc#3398.
The Icons class defines icons as
IconData
constants. This has lead a number of devs to use the implementation (e.g.IconData(57399, fontFamily: 'MaterialIcons')
) rather than the interfaceIcons.airplane
. This is a problem because all codepoints (e.g. 57399) change every time the font is updated.Is there an option or annotation to hide the implementation in docs?
The text was updated successfully, but these errors were encountered: