Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/internationalization/translatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions src/lib/output/themes/default/layouts/default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export const defaultLayout = (
{context.options.getValue("customCss") && (
<link rel="stylesheet" href={context.relativeURL("assets/custom.css", true)} />
)}
{context.options.getValue("customJs") && (
<script defer src={context.relativeURL("assets/custom.js", true)}></script>
)}
<script defer src={context.relativeURL("assets/main.js", true)}></script>
<script async src={context.relativeURL("assets/icons.js", true)} id="tsd-icons-script"></script>
<script async src={context.relativeURL("assets/search.js", true)} id="tsd-search-script"></script>
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 @@ -137,6 +137,7 @@ export interface TypeDocOptionMap {
darkHighlightTheme: ShikiTheme;
highlightLanguages: string[];
customCss: string;
customJs: string;
markdownItOptions: ManuallyValidatedOption<Record<string, unknown>>;
/**
* Will be called when TypeDoc is setting up the markdown parser to use to render markdown.
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 @@ -329,6 +329,11 @@ export function addTypeDocOptions(options: Pick<Options, "addDeclaration">) {
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(),
Expand Down