Allow categorizing exported types in the sidebar
Search Terms
sidebar, category, exports, class, interface
Problem
When exporting a large project the sidebar quickly gets overloaded with semi-internal types that 99% of users won't use, thus burying the types that are actually relevant.
Suggested Solution
It would be great if adding @category foo-bar to an exported type would split the sidebar into groups. This would then allow for use cases such as:
- having a single main export (function/class/etc) that is prominently separated from all the helper types
- logically grouping like types that have disparate names
- segregating away all the types that are only exposed for the <1% of people who might need them
Dupe of #1332, which I could have sworn I replied to with the issues I ran into the last time I tried this... but apparently not
Essentially what stopped this then was that the sidebar then no longer matched the page order... but I just ran another test, and apparently this would correct this problem, not cause it!
It wouldn't fix the "functions with multiple categories get rendered twice" issue, but that's fine. I don't have a good solution for this yet.

Yeah I thought it might be a dupe of that, but it was so terse I couldn't fully tell.
I know it's only semi-related, but I would consider the double-declaration a feature, not a bug. If it's in multiple categories I would honestly expect it to do that.
That's... a really good point. Okay, yeah, I'd be fine treating that as a feature. Just need to fix the duplicate id in the page for links in 0.21 then.
It would be cool if this could cover instance members for interfaces and classes as well as exported members of modules.
Any news regarding this feature @Gerrit0? thanks for the tool btw it's awesome
Nope, I don't think this was something that was done in #1794, shouldn't be too difficult to do though.
is this feature available now ? Don't see any news regarding this feature
Now that it's implemented, it took me some time to figure out how to actually use the feature, and in the end it was as simple as adding the following to my typedoc.json (you can change the category names of course):
{
"navigation": {
"includeCategories": true
},
"defaultCategory": "Utility",
"categoryOrder": [
"Core",
"Utility",
"Advanced",
"Internal"
]
}
Then you can tag types/functions/etc with @category <name> and they will be displayed under this section in the sidebar.
Btw a thousand times thank you for this great tool! It's simple to use and the generated documentation is really good looking and easy to navigate.