Skip to content

Commit 60c4d53

Browse files
committed
Add navigation.fullTree option
1 parent 82016b8 commit 60c4d53

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

.config/typedoc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"Enumerations": 2.0,
3838
"Type Aliases": 2.0
3939
},
40+
"navigation": {
41+
"fullTree": true
42+
},
4043
"includeVersion": true,
4144
"logLevel": "Verbose"
4245
}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
### Features
44

55
- Added support for TypeScript 5.1, #2296.
6+
- Added `navigation.fullTree` to control rendering the full navigation tree on each page, #2287.
7+
This option will likely be replaced in 0.25 with dynamic loading of the full tree.
68
- TypeDoc's `--pretty` option now also controls whether generated HTML contains line breaks, #2287.
79
- Optimized icon caching to reduce file size in generated HTML documentation, #2287.
810
- Render property description of "roughly top level" object types, #2276.

src/lib/output/themes/default/partials/navigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ export function navigation(context: DefaultThemeRenderContext, props: PageEvent<
156156
function links(mod: NavigationElement, parents: string[]) {
157157
const nameClasses = classNames(
158158
{ deprecated: mod instanceof Reflection && mod.isDeprecated() },
159-
!(mod instanceof Reflection) || mod.isProject() ? void 0 : context.getReflectionClasses(mod)
159+
mod instanceof DeclarationReflection ? context.getReflectionClasses(mod) : void 0
160160
);
161161

162162
const children = getNavigationElements(mod, opts);
163163

164-
if (!children.length) {
164+
if (!children.length || (!opts.fullTree && mod instanceof Reflection && !inPath(mod))) {
165165
return createNavElement(mod, nameClasses);
166166
}
167167

src/lib/utils/options/declaration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export interface TypeDocOptionMap {
139139
navigation: {
140140
includeCategories: boolean;
141141
includeGroups: boolean;
142+
fullTree: boolean;
142143
};
143144
visibilityFilters: ManuallyValidatedOption<{
144145
protected?: boolean;

src/lib/utils/options/sources/typedoc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ export function addTypeDocOptions(options: Pick<Options, "addDeclaration">) {
440440
defaults: {
441441
includeCategories: false,
442442
includeGroups: false,
443+
fullTree: false,
443444
},
444445
});
445446

0 commit comments

Comments
 (0)