-
Notifications
You must be signed in to change notification settings - Fork 45
components category
@category puts a symbol's generated page into an explicit sidebar group instead
of its default kind section (Classes, Modules, Namespaces, …):
/**
* @category Core
*/
export class Parser {}Parser now lives under a Core group rather than under Classes.
Important
@category is an unknown tag — set tags.allowUnknownTags: true in your
jsdoc.json or JSDoc strips it before the theme runs. See the
overview. (TypeDoc needs no flag.)
Note
This grouping behavior is for the JSDoc sidebar. Under the TypeDoc
flavor, @category is still parsed but does not affect the API sidebar —
that sidebar is a module/folder hierarchy instead. See
The TypeDoc sidebar.
@group is recognized as a sibling to @category (TypeDoc's own grouping tag).
The same caveat applies: it's parsed, but it does not shape the TypeDoc API
sidebar either — see
The TypeDoc sidebar. There
is no opt-in today to make @category / @group drive the TypeDoc sidebar.
parseCategory (in
generate-site.ts)
splits the tag text on whitespace, then:
- The leading run of plain tokens is the group path, joined with a single space.
- Parsing switches to options at the first token containing
=. Everything from there on iskey=value. - A literal
/is what nests a group. Spaces do not nest.
This is the subtle part. A space is just part of the group name — only /
creates a parent ▸ child relationship.
/** @category Getting Started */
export class Intro {}→ one flat group literally named Getting Started (the space is kept).
/** @category Core/Parsing */
export class Lexer {}→ nests the page under Core ▸ Parsing.
You can nest as deep as you like — @category Core/Parsing/Internals →
Core ▸ Parsing ▸ Internals.
If a symbol carries more than one @category, the first one is used; the
rest are ignored.
The only @category option today is order — the within-group sort key:
/** @category Core/Parsing order=1 */
export class Lexer {}
/** @category Core/Parsing order=2 */
export class Token {}Lexer sorts before Token inside Core ▸ Parsing. The path is the leading
tokens; options follow the first =, so Getting Started order=1 is the group
Getting Started with order=1.
Note
A missing or non-numeric order is left undefined — the page then sorts
last, alphabetically, like an untagged one.
/** @category Core */
export class A {} // → Core
/** @category Core/Schema order=1 */
export class Point {} // → Core ▸ Schema, first
/** @category Data Pipeline */
export class Stage {} // → "Data Pipeline" (one group; space kept)
/** @category Advanced/Internals order=10 */
export class Cache {} // → Advanced ▸ Internals, order 10order= inline on @category and the standalone @order
tag both feed the same sort key. When a symbol has both, the inline
@category … order= wins — see
the precedence rule on the @order page.
@category is one lever in the theme's single sidebar-ordering engine — every
entry carries a group path and an optional order. The prose counterpart is a
guide page's group frontmatter (same /-nesting rules). The full model —
nested paths, leaf-vs-branch ordering, clubSidebarItems, sectionOrder,
docGroups, and menu — is in
Structure your sidebar.
-
Components overview — the full tag list +
allowUnknownTags. -
@order— ordering symbols without a category. - Structure your sidebar — how groups + order combine.
This wiki is auto-generated from docs-site/docs. Edit there — changes sync automatically. Full docs: https://ankdev.me/clean-jsdoc-theme/