Skip to content

Commit

Permalink
Changed scope of optional headings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfigg committed Oct 8, 2024
1 parent 4371c27 commit 8f01072
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
31 changes: 16 additions & 15 deletions src/lib/output/themes/default/partials/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@ export const header = (context: DefaultThemeRenderContext, props: PageEvent<Refl
return (
<div class="tsd-page-title">
{!!props.model.parent && <ul class="tsd-breadcrumb">{context.breadcrumb(props.model)}</ul>}
{(!props.model.isProject() || opts.project) && (!props.model.isDocument() || opts.document) && (
<h1 class={classNames({ deprecated: props.model.isDeprecated() })}>
{props.model.kind !== ReflectionKind.Project &&
`${context.internationalization.kindSingularString(props.model.kind)} `}
{getDisplayName(props.model)}
{hasTypeParameters(props.model) && (
<>
{"<"}
{join(", ", props.model.typeParameters, (item) => item.name)}
{">"}
</>
)}
{context.reflectionFlags(props.model)}
</h1>
)}
{(!props.model.isProject() || props.url !== "index.html" || opts.readme) &&
(!props.model.isDocument() || opts.document) && (
<h1 class={classNames({ deprecated: props.model.isDeprecated() })}>
{props.model.kind !== ReflectionKind.Project &&
`${context.internationalization.kindSingularString(props.model.kind)} `}
{getDisplayName(props.model)}
{hasTypeParameters(props.model) && (
<>
{"<"}
{join(", ", props.model.typeParameters, (item) => item.name)}
{">"}
</>
)}
{context.reflectionFlags(props.model)}
</h1>
)}
</div>
);
};
2 changes: 1 addition & 1 deletion src/lib/utils/options/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export interface TypeDocOptionMap {
excludeReferences: boolean;
};
headings: {
project: boolean;
readme: boolean;
document: boolean;
};
visibilityFilters: ManuallyValidatedOption<{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/options/sources/typedoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ export function addTypeDocOptions(options: Pick<Options, "addDeclaration">) {
help: (i18n) => i18n.help_headings(),
type: ParameterType.Flags,
defaults: {
project: true,
readme: true,
document: false,
},
});
Expand Down

0 comments on commit 8f01072

Please sign in to comment.