Skip to content

Commit

Permalink
Add navigation.fullTree option
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jun 4, 2023
1 parent 82016b8 commit 60c4d53
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .config/typedoc.json
Expand Up @@ -37,6 +37,9 @@
"Enumerations": 2.0,
"Type Aliases": 2.0
},
"navigation": {
"fullTree": true
},
"includeVersion": true,
"logLevel": "Verbose"
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,8 @@
### Features

- Added support for TypeScript 5.1, #2296.
- Added `navigation.fullTree` to control rendering the full navigation tree on each page, #2287.
This option will likely be replaced in 0.25 with dynamic loading of the full tree.
- TypeDoc's `--pretty` option now also controls whether generated HTML contains line breaks, #2287.
- Optimized icon caching to reduce file size in generated HTML documentation, #2287.
- Render property description of "roughly top level" object types, #2276.
Expand Down
4 changes: 2 additions & 2 deletions src/lib/output/themes/default/partials/navigation.tsx
Expand Up @@ -156,12 +156,12 @@ export function navigation(context: DefaultThemeRenderContext, props: PageEvent<
function links(mod: NavigationElement, parents: string[]) {
const nameClasses = classNames(
{ deprecated: mod instanceof Reflection && mod.isDeprecated() },
!(mod instanceof Reflection) || mod.isProject() ? void 0 : context.getReflectionClasses(mod)
mod instanceof DeclarationReflection ? context.getReflectionClasses(mod) : void 0
);

const children = getNavigationElements(mod, opts);

if (!children.length) {
if (!children.length || (!opts.fullTree && mod instanceof Reflection && !inPath(mod))) {
return createNavElement(mod, nameClasses);
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/options/declaration.ts
Expand Up @@ -139,6 +139,7 @@ export interface TypeDocOptionMap {
navigation: {
includeCategories: boolean;
includeGroups: boolean;
fullTree: boolean;
};
visibilityFilters: ManuallyValidatedOption<{
protected?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/options/sources/typedoc.ts
Expand Up @@ -440,6 +440,7 @@ export function addTypeDocOptions(options: Pick<Options, "addDeclaration">) {
defaults: {
includeCategories: false,
includeGroups: false,
fullTree: false,
},
});

Expand Down

0 comments on commit 60c4d53

Please sign in to comment.