Skip to content

Option to disable compact navigation structure when a category contains only one reflection #2667

@NkemdiAnyiam

Description

@NkemdiAnyiam

Search Terms

compact, navigation, single reflection

Problem

Given: The typedoc.json navigation.includeCategories option is set to true.

When there is only one reflection with a given @category tag, the rendered docs will not render the category as a dropdown. Instead, it will be displayed in a compact form, i.e., "(category name)/(reflection name)". This can be visually confusing (and aesthetically unpleasing), especially when there are other categories that are not compacted.

For example, suppose I have a module named colors.ts which has 7 interfaces named Red, Orange, Yellow, Green, Blue, Purple, and Gray and 1 class named Color. And suppose I separated the interfaces into 3 categories: "Warm", "Cool", and "Neutral". The rendered navigation for the colors module would look like the following:
image
I would like to be able to render it as a dropdown like the following despite Gray being the only reflection categorized under "Neutral":
image

Suggested Solution

Add an additional boolean configuration option like navigation.compactOrganization or navigation.compactStructure (I'm not sure of the best name). It can default to true (in which case, nothing changes), but if set to false, categories (and groups) containing only a single reflection will still render a dropdown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueEasier issue for first time contributorshelp wantedContributions are especially encouraged

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions