Skip to content

Commit 9b31414

Browse files
committed
feat: set theme option automatically
1 parent 973f75d commit 9b31414

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ yarn add typedoc-github-theme
2727
**Use the theme when generating your documentation:**
2828

2929
```text
30-
typedoc src/** */ --plugin typedoc-github-theme --theme typedoc-github-theme
30+
npx typedoc src --plugin typedoc-github-theme
3131
```
3232

33+
> [!NOTE]
34+
> This plugin fills the following options if they have not been defined by the user:
35+
> [`theme`](https://typedoc.org/options/output/#theme), [`lightHighlightTheme`](https://typedoc.org/options/output/#lighthighlighttheme), [`darkHighlightTheme`](https://typedoc.org/options/output/#darkhighlighttheme)
36+
3337
---
3438

3539
## Author

src/index.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,14 @@ import { GitHubTheme } from './GitHubTheme';
66
*/
77
export function load(app: Application) {
88
app.renderer.defineTheme('typedoc-github-theme', GitHubTheme);
9+
10+
app.on('bootstrapEnd', () => {
11+
if (app.options.isSet('theme') && app.options.getValue('theme') !== 'typedoc-github-theme') {
12+
return app.logger.warn(
13+
`The theme'typedoc-github-theme' is not used because another theme (${app.options.getValue('theme')}) was specified!`
14+
);
15+
}
16+
17+
app.options.setValue('theme', 'typedoc-github-theme');
18+
});
919
}

0 commit comments

Comments
 (0)