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 option to generate documentation for private classes #2154
Comments
This is as designed. We could add an option to document these, however. |
@sathishmscict Are you referring to identifiers that begin with an underscore (_) or identifiers that are not |
I'd be interested in it documenting anything in a library that is not explicitly exported as part of its API please! |
I'd also be interested in the ability to generate docs for all classes, including private classes. I have a private class initialized within another class (that is exported/public) to ensure that they cannot initialize it outside of the class and so it doesn't pollute intellisense, but I'd like them to be able to read the documentation on the internal functions for that class. |
In Flutter we have stateful widgets, where the public class is normally small and uninteresting, with all the logic in a State class with a private name. These State classes demand documenting! |
Any updates on this? Is there any option to document private classes also? |
There is no update as yet, but since there's been continuing traffic on this feature request, elevating to P2. |
It sounds like the general trend is to desire documentation for all private library members in a library or even package. If it is going to be at the library or package level I'd perhaps lean toward a dartdoc_options parameter listing files and/or toggling the whole package. Not very fine grained, but either of those two options would get the job done in many cases. Otherwise, a |
@visibleInDocumentation seems the best bet here- as that also gives the option to document certain private members while keeping others completely private. |
All of this could be done, where the more specific overrules the more general. In the flutter case, I would like to document my own packages, and not all packages, thus the package level would suit me. |
Since annotations can be present on libraries, if we do both probably the dartdoc_options version would be limited to entire packages or directory trees. This would also be a good time to deprecate the archaic |
The option to include private classes ( |
yes it would be great if we could document statefulwidgets too. If anyone can point to where private class logging can be enabled, I would like to create a fork and use that meanwhile |
This would be nice to have please. |
Another use-case: I use documentation mostly for my team when I'm writing apps, since the users are probably never going to see the API docs. So I want my team to be able to see everything -- private and non-exported classes still have to be maintained! Using the generated website's search bar is much easier than scrolling through files and guessing where the class you're looking for may be, then having to search within that file for what you're looking for. Having an option that documents literally everything (in my own project, not all my imports), would fix this. |
That's a solid use case. In many cases, docs are for authors of the code, not clients of the code. For example, every flutter app ever 😛. |
Any updates on this? |
Anything new on this? I would really like to be able to have this feature. I agree with |
Just to flesh out a use case: Running dartdoc on private classes would be really nice when people use the state pattern. Navigating around a deep inheritance tree isn't very well supported in the Dart ecosystem. Dartdoc of private classes provides a quick path to get there, especially via the "Implementers" link. |
No change on prioritization here. This is still a P2 enhancement, and we don't currently have time scheduled to implement it. |
@jcollins-g @srawlins, I'd like to take this up. I have made good progress on my local build of the My current implementation starts with a config option Right now, my implementation only has three problems:
|
The only things I can think of are:
Hmm, what does dartdoc do today for public libraries in this situation? For example, if |
I would expect the same thing to happen here as happens if one public library reexports another public library -- members of both will be subject to dartdoc canonicalization and a single version of the member's doc will be referenced in both libraries. In any implementation for this, we have to consider whether we're making more private things public, or creating a new sort of thing where private things are allowed to be documented. Which you do depends on the problem you're trying to solve -- if you still want the classes treated as private for canonicalization it will matter which direction you go. There may also be some assumptions in the code that private elements can not be canonical and/or documented, I'd watch for that. |
Definitely the latter. I don't want to change the meaning of the code itself, but rather expose all possible members to documentation so a team can read through their own API without opening the code. Also because the pages dartdocs generates are really nice to look at. Honestly, my favorite part of using a new package is going through their dartdocs to understand the API.
Yeah, I'm having a lot of "fun" figuring out which |
Yeah.
I'd say we do the same things we do for libraries |
What if they're not part of a public library? What if some elements are part of a public library, and some are not? What if some elements are part of multiple public libraries? What if some elements are part of one public library, and others are part of another? I think the simplest and least surprising choice is to document each library in |
I'm seeing two options: One, do what's currently done for non- Two, reduce clutter in the sidebar by omitting
I think this can be justified because Or, we could leave this to another config option, |
FYI I'll be tracking my progress and asking future questions in #3096 |
In final documentation private classes , methods and properties are not visible. Rest of the all classes documentation generated properly.
The text was updated successfully, but these errors were encountered: