-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin-pages): use new option format, fix issue with pages order…
…ing, rework theme plugins
- Loading branch information
Showing
21 changed files
with
176 additions
and
300 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
File renamed without changes.
57 changes: 57 additions & 0 deletions
57
packages/typedoc-plugin-pages/src/options/build-options.ts
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { LogLevel, ParameterHint, ParameterType } from 'typedoc'; | ||
|
||
import { OptionGroup } from '@knodes/typedoc-pluginutils'; | ||
|
||
import type { PagesPlugin } from '../plugin'; | ||
import { EInvalidPageLinkHandling, IPluginOptions } from './plugin-options'; | ||
|
||
|
||
export const buildOptions = ( plugin: PagesPlugin ) => OptionGroup.factory<IPluginOptions>( plugin ) | ||
.add( 'enablePageLinks', { | ||
help: 'Whether or not @page and @pagelink tags should be parsed.', | ||
type: ParameterType.Boolean, | ||
defaultValue: true, | ||
} ) | ||
.add( 'enableSearch', { | ||
help: 'Whether or not the pages should be added to the search index.', | ||
type: ParameterType.Boolean, | ||
defaultValue: true, | ||
} ) | ||
.add( 'searchBoost', { | ||
help: 'The score multiplier for pages in search.', | ||
type: ParameterType.Number, | ||
defaultValue: 10, | ||
} ) | ||
.add( 'invalidPageLinkHandling', { | ||
help: 'The kind of error to throw in case of an invalid page link.', | ||
type: ParameterType.Map, | ||
map: EInvalidPageLinkHandling, | ||
defaultValue: EInvalidPageLinkHandling.FAIL, | ||
} ) | ||
.add( 'pages', { | ||
help: 'Actual pages definitions.', | ||
type: ParameterType.Mixed, | ||
}, v => { | ||
v = v ?? []; | ||
// TODO: Better checks | ||
return v as any; | ||
} ) | ||
.add( 'output', { | ||
help: 'Output directory where your pages will be rendered. This must be a relative path.', | ||
type: ParameterType.Path, | ||
hint: ParameterHint.Directory, | ||
defaultValue: 'pages', | ||
}, v => plugin.relativeToRoot( v ) ) | ||
.add( 'source', { | ||
help: 'Root directory where all page source files live.', | ||
type: ParameterType.Path, | ||
hint: ParameterHint.Directory, | ||
defaultValue: 'pages', | ||
} ) | ||
.add( 'logLevel', { | ||
help: 'The plugin log level.', | ||
type: ParameterType.Map, | ||
map: LogLevel, | ||
defaultValue: plugin.application.logger.level, | ||
} ) | ||
.build(); |
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,3 +1,3 @@ | ||
export * from './build-options'; | ||
export * from './pages'; | ||
export * from './plugin-options'; | ||
export * from './read-plugin-options'; |
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
97 changes: 0 additions & 97 deletions
97
packages/typedoc-plugin-pages/src/options/read-plugin-options.spec.ts
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
packages/typedoc-plugin-pages/src/options/read-plugin-options.ts
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
packages/typedoc-plugin-pages/src/page-tree/fallback-render-page-link.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.