Skip to content

Commit 59a33de

Browse files
committed
Partials: settings, primaryNavigation, secondaryNavigation
Resolves #1987
1 parent d9de9f7 commit 59a33de

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Improved support for `--entryPointStrategy Packages`. TypeDoc will now load package-specific configurations from `package.json` `typedoc` field. This configuration allows configuring a custom display name (`typedoc.displayName`) field, entry point (`typedoc.entryPoint` - this is equivalent and will override `typedocMain`), and path to a readme file to be rendered at the top of the package page (`typedoc.readmeFile`), #1658.
66
- The `--includeVersion` option will now be respected by `--entryPointStrategy Packages`. Also, for this combination, missing `version` field in the root `package.json` will not issue a warning.
7+
- The `navigation` partial will now call the new `settings`, `primaryNavigation`, and `secondaryNavigation` partials, #1987.
78

89
### Bug Fixes
910

src/lib/output/themes/default/DefaultThemeRenderContext.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ import { memberSignatures } from "./partials/member.signatures";
2121
import { memberSources } from "./partials/member.sources";
2222
import { members } from "./partials/members";
2323
import { membersGroup } from "./partials/members.group";
24-
import { navigation } from "./partials/navigation";
24+
import {
25+
navigation,
26+
primaryNavigation,
27+
secondaryNavigation,
28+
settings,
29+
} from "./partials/navigation";
2530
import { parameter } from "./partials/parameter";
2631
import { toolbar } from "./partials/toolbar";
2732
import { type } from "./partials/type";
@@ -83,6 +88,9 @@ export class DefaultThemeRenderContext {
8388
members = bind(members, this);
8489
membersGroup = bind(membersGroup, this);
8590
navigation = bind(navigation, this);
91+
settings = bind(settings, this);
92+
primaryNavigation = bind(primaryNavigation, this);
93+
secondaryNavigation = bind(secondaryNavigation, this);
8694
parameter = bind(parameter, this);
8795
toolbar = bind(toolbar, this);
8896
type = bind(type, this);

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { ContainerReflection, DeclarationReflection, Reflection, ReflectionKind } from "../../../../models";
22
import { JSX, partition } from "../../../../utils";
33
import type { PageEvent } from "../../../events";
4-
import { classNames, camelToTitleCase, wbr } from "../../lib";
4+
import { camelToTitleCase, classNames, wbr } from "../../lib";
55
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
66

77
export function navigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>) {
88
return (
99
<>
10-
{settings(context)}
11-
{primaryNavigation(context, props)}
12-
{secondaryNavigation(context, props)}
10+
{context.settings()}
11+
{context.primaryNavigation(props)}
12+
{context.secondaryNavigation(props)}
1313
</>
1414
);
1515
}
@@ -26,7 +26,7 @@ function buildFilterItem(context: DefaultThemeRenderContext, name: string, displ
2626
);
2727
}
2828

29-
function settings(context: DefaultThemeRenderContext) {
29+
export function settings(context: DefaultThemeRenderContext) {
3030
const defaultFilters = context.options.getValue("visibilityFilters") as Record<string, boolean>;
3131

3232
const visibilityOptions: JSX.Element[] = [];
@@ -82,7 +82,7 @@ function settings(context: DefaultThemeRenderContext) {
8282
);
8383
}
8484

85-
function primaryNavigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>) {
85+
export function primaryNavigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>) {
8686
// Create the navigation for the current page
8787

8888
const modules = props.model.project.getChildrenByKind(ReflectionKind.SomeModule);
@@ -130,7 +130,7 @@ function primaryNavigation(context: DefaultThemeRenderContext, props: PageEvent<
130130
}
131131
}
132132

133-
function secondaryNavigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>) {
133+
export function secondaryNavigation(context: DefaultThemeRenderContext, props: PageEvent<Reflection>) {
134134
// Multiple entry points, and on main project page.
135135
if (props.model.isProject() && props.model.getChildrenByKind(ReflectionKind.Module).length) {
136136
return;

0 commit comments

Comments
 (0)