Skip to content

Commit

Permalink
Correct custom theme docs, #2490
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jan 27, 2024
1 parent cb4ae38 commit eb7510b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions internal-docs/custom-themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TypeDoc's default analytics helper with one that uses [Open Web Analytics](https
Google Analytics. This could be done with the following theme:

```tsx
import { Application, DefaultTheme, PageEvent, JSX } from "typedoc";
import { Application, DefaultTheme, PageEvent, JSX, Reflection } from "typedoc";

const script = `
(function() {
Expand Down Expand Up @@ -48,13 +48,8 @@ class MyThemeContext extends DefaultThemeRenderContext {
}

class MyTheme extends DefaultTheme {
private _contextCache?: MyThemeContext;
override getRenderContext() {
this._contextCache ||= new MyThemeContext(
this._markedPlugin,
this.application.options,
);
return this._contextCache;
getRenderContext(pageEvent: PageEvent<Reflection>) {
return new MyThemeContext(this, pageEvent, this.application.options);
}
}

Expand Down

0 comments on commit eb7510b

Please sign in to comment.