Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correctly define theme using TypeDoc
defineTheme
method
- Loading branch information
Showing
12 changed files
with
196 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,11 @@ | ||
import * as path from 'path'; | ||
|
||
import { Options, OptionsReader } from 'typedoc'; | ||
import { Logger } from 'typedoc/dist/lib/utils'; | ||
|
||
export class CustomOptionsReader implements OptionsReader { | ||
priority = 900; | ||
|
||
name = 'custom-options'; | ||
|
||
read(container: Options, logger: Logger) { | ||
const options = this.getOptionsFile( | ||
path.resolve(path.join(container.getValue('theme'), 'options.js')), | ||
); | ||
if (options) { | ||
Object.entries(options).forEach(([key, value]) => { | ||
container.setValue(key, value); | ||
}); | ||
} | ||
} | ||
|
||
getOptionsFile(optionsFile: string) { | ||
try { | ||
return require(optionsFile).default; | ||
} catch (e) { | ||
return null; | ||
export class MarkdownThemeOptionsReader implements OptionsReader { | ||
priority = 1000; | ||
name = 'markdown-theme-reader'; | ||
read(container: Options) { | ||
if (container.getValue('theme') === 'default') { | ||
container.setValue('theme', 'markdown'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.