Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom footer string when hideDeclaration is true #2562

Merged
merged 3 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 13 additions & 8 deletions src/lib/output/themes/default/partials/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import { JSX } from "../../../../utils";
import { JSX, Raw } from "../../../../utils";
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";

export function footer(context: DefaultThemeRenderContext) {
const hideGenerator = context.options.getValue("hideGenerator");
const customFooter = context.options.getValue("footer");
return (
<footer>
{context.hook("footer.begin")}
{hideGenerator || (
<p class="tsd-generator">
{"Generated using "}
<a href="https://typedoc.org/" target="_blank">
TypeDoc
</a>
</p>
{customFooter ? (
<Raw html={customFooter} />
Gerrit0 marked this conversation as resolved.
Show resolved Hide resolved
) : (
!hideGenerator && (
<p class="tsd-generator">
{"Generated using "}
<a href="https://typedoc.org/" target="_blank">
TypeDoc
</a>
</p>
)
)}
{context.hook("footer.end")}
</footer>
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/options/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export interface TypeDocOptionMap {
cacheBust: boolean;
gaID: string;
hideGenerator: boolean;
footer: string;
hideParameterTypesInTitle: boolean;
searchInComments: boolean;
cleanOutputDir: boolean;
Expand Down
5 changes: 5 additions & 0 deletions src/lib/utils/options/sources/typedoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ export function addTypeDocOptions(options: Pick<Options, "addDeclaration">) {
help: "Do not print the TypeDoc link at the end of the page.",
type: ParameterType.Boolean,
});
options.addDeclaration({
name: "footer",
help: "Set custom footer when hideGenerator option is set to true",
Gerrit0 marked this conversation as resolved.
Show resolved Hide resolved
type: ParameterType.String,
});
options.addDeclaration({
name: "hideParameterTypesInTitle",
help: "Hides parameter types in signature titles for easier scanning.",
Expand Down