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

Suggestion: Category improvements #866

Closed
rbuckton opened this issue Oct 3, 2018 · 3 comments
Closed

Suggestion: Category improvements #866

rbuckton opened this issue Oct 3, 2018 · 3 comments
Labels
enhancement Improved functionality

Comments

@rbuckton
Copy link
Contributor

rbuckton commented Oct 3, 2018

When categorization was added in #566, there was nothing added to the built-in templates to make categories useful. The suggestion in #566 (comment) provides some guidance, but overall the solution has some issues:

  • There is no category for uncategorized reflections.
  • Uncategorized reflections are lost using the suggested template.
  • Categories override groups with this approach.

As such, I would like to suggest the following improvements to categories:

  1. Add categories to groups. This would let the built-in template organize by group and then category.
  2. Support an "Other" category (possibly configurable). This would be the category to place uncategorized reflections when there are other reflections that have a category.
  3. Support category sorting via configuration/options.
  4. Consider supporting multiple categories for an item (nice to have, but not strictly necessary).

I ended up implementing (1), (2), and (3) in a custom plugin I wrote for my project to work around a number of other issues:

Here's an example:
categories

@jonchardy
Copy link
Contributor

Since I worked on the original categories, I'm willing to help out here. It would be nice to get an idea of where people want to see this go.

I can see different methods of categorization (and this is why I didn't implement anything on the theme side, since at the time I knew people would want to do different things with categories):

  1. Lump categories, which include reflections from different groups. This is something we do in our index, where we have broad categories that include both classes and interfaces. I think this is most useful at the project level, as lump categories don't make as much sense once you're dealing with methods vs properties.
  2. Group categories, as shown by @rbuckton . This would allow classes, methods, etc. to be categorized within their groups. Within a group, I imagine if all categories fall into the default category, we would just output the default group title, rather than including category information.

I certainly agree we can add more configuration options to specify category weights and a default category. And we should probably force users to pick either group categorization or lump categorization, which we could then turn into another option.

@jonchardy
Copy link
Contributor

How should uncategorized reflections work when the default category is in use?

Say I have some category, "Foo," and I categorize some classes under it. If I set my default category to "Foo," I'd expect any uncategorized reflections to fall into that category. At that point, the category can't really be considered uncategorized since some classes were explicitly put there.

@jonchardy
Copy link
Contributor

#938

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality
Projects
None yet
Development

No branches or pull requests

3 participants