diff --git a/src/lib/internationalization/translatable.ts b/src/lib/internationalization/translatable.ts index d325c69ea..35e319807 100644 --- a/src/lib/internationalization/translatable.ts +++ b/src/lib/internationalization/translatable.ts @@ -242,6 +242,7 @@ export const translatable = { help_highlightLanguages: "Specify the languages which will be loaded to highlight code when rendering", help_customCss: "Path to a custom CSS file to for the theme to import", + help_customJs: "Path to a custom JS file to import", help_markdownItOptions: "Specify the options passed to markdown-it, the Markdown parser used by TypeDoc", help_markdownItLoader: diff --git a/src/lib/output/themes/default/layouts/default.tsx b/src/lib/output/themes/default/layouts/default.tsx index e06c36bf7..a50dab36c 100644 --- a/src/lib/output/themes/default/layouts/default.tsx +++ b/src/lib/output/themes/default/layouts/default.tsx @@ -28,6 +28,9 @@ export const defaultLayout = ( {context.options.getValue("customCss") && ( )} + {context.options.getValue("customJs") && ( + + )} diff --git a/src/lib/utils/options/declaration.ts b/src/lib/utils/options/declaration.ts index bd3290e7b..9188a19ba 100644 --- a/src/lib/utils/options/declaration.ts +++ b/src/lib/utils/options/declaration.ts @@ -138,6 +138,7 @@ export interface TypeDocOptionMap { darkHighlightTheme: ShikiTheme; highlightLanguages: string[]; customCss: string; + customJs: string; markdownItOptions: ManuallyValidatedOption>; /** * Will be called when TypeDoc is setting up the markdown parser to use to render markdown. diff --git a/src/lib/utils/options/sources/typedoc.ts b/src/lib/utils/options/sources/typedoc.ts index ad46a33e4..94f9b589c 100644 --- a/src/lib/utils/options/sources/typedoc.ts +++ b/src/lib/utils/options/sources/typedoc.ts @@ -329,6 +329,11 @@ export function addTypeDocOptions(options: Pick) { help: (i18n) => i18n.help_customCss(), type: ParameterType.Path, }); + options.addDeclaration({ + name: "customJs", + help: (i18n) => i18n.help_customJs(), + type: ParameterType.Path, + }); options.addDeclaration({ name: "markdownItOptions", help: (i18n) => i18n.help_markdownItOptions(),