dart-lang / dartdoc

API documentation tool for Dart.
https://pub.dev/packages/dartdoc
BSD 3-Clause "New" or "Revised" License
473 stars 119 forks source link

Constructor property setters should include documentation for those properties #2617

Open tvolkert opened 3 years ago

tvolkert commented 3 years ago

Consider the following constructor:

https://api.flutter.dev/flutter/material/MaterialApp/MaterialApp.html

It looks like this in the API docs:

Screen Shot 2021-04-12 at 9 58 28 AM

None of the parameters to the constructor are documented... despite every single one of the corresponding member variables being documented (e.g. https://api.flutter.dev/flutter/material/MaterialApp/localizationsDelegates.html).

Our dartdocs should make it clear that these constructor parameters are setting the corresponding member variables and either (a) provide a hyperlink to the documentation for the corresponding member variables, or (b) inline those docs in a way that would be easy for a human to parse.

Note that this is particularly bad for new developers, because they don't necessarily know that these constructor parameters even map to member variables that [might] have their own docs.

tvolkert commented 3 years ago

Cross-filing from https://github.com/flutter/flutter/issues/80292

jcollins-g commented 3 years ago

Adding designer label as all the data is available in the templates, someone will just need to come up with something that looks reasonable here.

tvolkert commented 3 years ago

@jcollins-g do you know who usually does the designs?

guidezpl commented 2 years ago

Would love to see this, plus support for this and super. The constructor pages are currently super helpful.

Related: https://github.com/dart-lang/dartdoc/issues/1451 and https://github.com/dart-lang/dartdoc/issues/1229

InMatrix commented 2 years ago

Would it be sufficient to turn the parameters of the constructor into links to corresponding properties' docs?

a-siva commented 1 year ago

//cc @srawlins do you know who in the dartdoc team should be looking into this?

srawlins commented 1 year ago

I think no one.

Are you asking because it is P1?

a-siva commented 1 year ago

Are you asking because it is P1?

Yes, maybe the priority should be downgraded then.

srawlins commented 1 year ago

Sounds good

srawlins commented 1 year ago

Duplicate of the issue you filed years prior: https://github.com/dart-lang/dartdoc/issues/1958 😛 but this one has more discussion and a better example, especially of how we'll have to be thoughtful of how to present the field documentation. So I'm closing the older one.