Skip to content

Commit eb7510b

Browse files
committed
Correct custom theme docs, #2490
1 parent cb4ae38 commit eb7510b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

internal-docs/custom-themes.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TypeDoc's default analytics helper with one that uses [Open Web Analytics](https
1919
Google Analytics. This could be done with the following theme:
2020

2121
```tsx
22-
import { Application, DefaultTheme, PageEvent, JSX } from "typedoc";
22+
import { Application, DefaultTheme, PageEvent, JSX, Reflection } from "typedoc";
2323

2424
const script = `
2525
(function() {
@@ -48,13 +48,8 @@ class MyThemeContext extends DefaultThemeRenderContext {
4848
}
4949

5050
class MyTheme extends DefaultTheme {
51-
private _contextCache?: MyThemeContext;
52-
override getRenderContext() {
53-
this._contextCache ||= new MyThemeContext(
54-
this._markedPlugin,
55-
this.application.options,
56-
);
57-
return this._contextCache;
51+
getRenderContext(pageEvent: PageEvent<Reflection>) {
52+
return new MyThemeContext(this, pageEvent, this.application.options);
5853
}
5954
}
6055

0 commit comments

Comments
 (0)