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

Improve annotations...implemented by section (and hide annotations) #831

Closed kwalrath closed 9 years ago

kwalrath commented 9 years ago

Looking at https://new-dartdocs-dot-dartlang-api.appspot.com/1.12.0-dev.5.8/dart-html/Element-class.html, the first thing I see after the description is an annotations line that means nothing to me:

Annotations DocsEditable() DomName('Element')

Really, I care not a whit about these annotations, and they just obscure the interesting info about class hierarchy and interfaces. (Implemented by is interesting too, but not as crucial.)

Also, "Extends" doesn't seem right, either, since it lists the class hierarchy, not the single class (Node) that this extends.

I'd rather have the class hierarchy and implementation info visible, and then optionally expand the annotations and maybe "implemented by" info.

sethladd commented 9 years ago

Sounds like we need another annotation called "VisibleInDocs" :)

But seriously, there are other annotations which are very useful. So I don't think we can always hide them. Maybe put them under Extends ?

Also, "Extends" doesn't seem right, either, since it lists the class hierarchy, not the single class (Node) that this extends.

Suggestion for an alternative?

kwalrath commented 9 years ago

Maybe we don't need a label for such basic info? Java docs have no label at all, just the names of classes, indented: https://docs.oracle.com/javase/7/docs/api/javax/swing/AbstractAction.html.

Doxygen has an optional "Inheritance diagram", but I'm not sure how that'd work with Dart's "mixin-based inheritance". Here's a Doxygen example: http://download.autodesk.com/us/maya/2010help/API/class_m_fn_lattice_data.html

I found another doc set that uses "Inheritance" as a label for text; again, I'm not sure how that floats with mixins: http://www.yiiframework.com/doc/api/1.1/CMssqlColumnSchema

sethladd commented 9 years ago

Small tweaks. Annotations are now last. Changed Extends to Inheritance. dt's are now gray. Added colon.

screen shot 2015-08-21 at 12 43 48 pm

kwalrath commented 9 years ago

No "Implemented by"? "Mixes-in" should probably be either combined with inheritance, somehow, or on the second line. Maybe:

Inheritance: Object > SuperAwesomeClass (mixin: Mixin1) > ThisClass (mixins: Mixin2, Mixin3)
Interfaces: Interface1, Interface2
Implemented by: Implementer1, Implementer2
Annotations:  who cares

Oops, sorry about that last one. :)

sethladd commented 9 years ago

Inheritance: Object > SuperAwesomeClass (mixin: Mixin1) > ThisClass (mixins: Mixin2, Mixin3)

interesting! We can definitely try for that. I like it.

Annotations: who cares

Maybe people do :)

Implemented by: Implementer1, Implementer2

This is a feature request that has popped up a few times. This is really handy, I'd like to keep it.

sethladd commented 9 years ago

I know we didn't hide Annotations but I'm going to close this because we hopefully did improve it.

I'll open a specific issue for interlacing the Mixins with the inheritance list.