Skip to content
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

Support categories for member APIs #1681

Closed
nex3 opened this issue Apr 27, 2018 · 16 comments
Closed

Support categories for member APIs #1681

nex3 opened this issue Apr 27, 2018 · 16 comments
Labels
P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@nex3
Copy link
Member

nex3 commented Apr 27, 2018

For packages with many different APIs of a given type, it's useful to divide those APIs into categories rather than having them all sorted alphabetically. For example, in test's docs, there are so many matcher functions that it's hard for users to notice non-matcher functions like pumpEventQueue(). It would be very useful to be able to put the matchers in their own sub-section beneath "Functions" to keep everything organized. It would be similarly useful to be able to group classes, fields, and so on.

This is possible today with the {@category} annotation, but that only works for libraries. I'd love to see it generalized.

@devoncarew
Copy link
Member

The docs for atom.io do something similar - even for classes w/o a lot of methods, they break up the API into semantic categories:

https://atom.io/docs/api/v1.26.1/NotificationManager

@jcollins-g
Copy link
Contributor

I have generic categorization support in a local branch. It's coming.

@jcollins-g jcollins-g added type-enhancement A request for a change that isn't a bug P2 A bug or feature request we're likely to work on labels Apr 30, 2018
@jcollins-g
Copy link
Contributor

Categorization support is shaping up nicely and will be displayed as "api" and "APIs" in dartdoc generated pages. I'm working on the style bits and category page generation now.

@nex3
Copy link
Member Author

nex3 commented Sep 17, 2018

How long does it take for a change like this to percolate out into pub.dartlang.org/documentation?

@jcollins-g
Copy link
Contributor

I am planning to publish this week, tomorrow if I can. Afterwards the pub site maintainers have to pick it up, but they typically do that within a few days.

@nex3
Copy link
Member Author

nex3 commented Sep 24, 2018

I'm guessing this is live now? Is there any way to tell for sure?

@jcollins-g
Copy link
Contributor

It is published but the pub site maintainers have not yet picked it up:

https://github.com/dart-lang/pub-dartlang-dart/blob/master/pkg/pub_dartdoc/pubspec.yaml#L12

You should be able to try it out locally though with 0.21.1.

@jcollins-g
Copy link
Contributor

dart-lang/pub-dev#1645

@nex3
Copy link
Member Author

nex3 commented Sep 24, 2018

Thanks!

@nex3
Copy link
Member Author

nex3 commented Sep 24, 2018

It doesn't seem to be working locally for sass/dart-sass@cf2e416 with 0.21.1. The class list looks the same as ever.

@jcollins-g
Copy link
Contributor

It's not clear enough in the docs. I forgot to mention that if the categories are not declared in dartdoc_options.yaml, they're otherwise invisible in the generated docs.

See examples here and here.

@nex3
Copy link
Member Author

nex3 commented Sep 24, 2018

I've definitely got DartDoc recognizing the categories now, but it's still not using them to sort either the right-hand column or the main member list.

sass-categories

@jcollins-g
Copy link
Contributor

This is currently working as intended. To get a sorted list of importers, you click on "importers" and then only importers are displayed. Same with "values".

Admittedly this is a bit different than the way categories were handled for libraries, previously. I take it you'd like it do this? It wasn't clear to me that that was a win, but we can do that.

@nex3
Copy link
Member Author

nex3 commented Sep 24, 2018

I would like that. I'd actually prefer it to having an alphabetical list of tagged classes.

@jcollins-g
Copy link
Contributor

@nex3 I'll poll the other stakeholders and if I can get some broad agreement there, I'll implement it.

@canthelou-xyz
Copy link

categories: they are displayed under a Topics section on the left. To be displayed you need to create a markdown file where the content is the description of the topic.

Capture d’écran 2020-03-23 à 15 14 53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants