This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
81 additions
and
7 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Application, TypeDocOptions } from 'typedoc' | ||
|
||
import { EntryPoint } from '../interfaces' | ||
|
||
// Required for the typedoc-plugin-markdown plugin | ||
declare module 'typedoc' { | ||
export interface TypeDocOptionMap { | ||
entryDocument: string | ||
hidePageTitle: boolean | ||
hideBreadcrumbs: boolean | ||
hideInPageTOC: boolean | ||
} | ||
} | ||
|
||
export const typedocHtmlGroup = async ( | ||
entryPoints: EntryPoint[] | ||
): Promise<void> => { | ||
console.info('>>> Grouping generated docs...') | ||
|
||
const entryPointsJsons = entryPoints.map( | ||
ep => `${ep.generatedDocsPath}/docs.json` | ||
) | ||
|
||
const generatorConfig: Partial<TypeDocOptions> = { | ||
entryPointStrategy: 'merge', | ||
readme: 'none', | ||
entryPoints: entryPointsJsons | ||
} | ||
|
||
console.info('>>> Typedoc grouping', generatorConfig) | ||
const generatorApp = await Application.bootstrapWithPlugins(generatorConfig) | ||
|
||
const projectReflection = await generatorApp.convert() | ||
if (!projectReflection) { | ||
throw new Error('Failed to group generated docs') | ||
} | ||
|
||
console.info('>>> Generating grouped typedoc docs...') | ||
await generatorApp.generateDocs(projectReflection, '.tbdocs/docs') | ||
} |
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