Skip to content

Commit

Permalink
Update TypeDoc 0.25.x
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonrt committed Dec 31, 2023
1 parent 7f8787f commit 4fdd0be
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions src/generate/typedoc/typedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import fs from 'fs-extra';
import {
Application,
LogLevel,
ParameterType,
TSConfigReader } from 'typedoc';

/**
Expand Down Expand Up @@ -61,20 +60,7 @@ export async function typedoc(config, logLevel = LogLevel.Info)
async function generate(config, logLevel, mdnDataPath)
{
// Create a new TypeDoc application instance
const app = new Application();

// Set TypeDoc options
app.options.addReader(new TSConfigReader());

// Add option to pass the config year to plugins.
app.options.addDeclaration({
name: 'mdnDataPath',
help: 'This is output path for the internal mdn-links plugin.',
type: ParameterType.String,
defaultValue: null,
});

await app.bootstrapWithPlugins({
const app = await Application.bootstrapWithPlugins({
name: config.name,

// Adds mdn-links CSS variables.
Expand All @@ -89,9 +75,6 @@ async function generate(config, logLevel, mdnDataPath)
// Sets favicon.
dmtFavicon: config.favicon,

// Removes the default module page including from navigation & breadcrumbs
dmtRemoveDefaultModule: true,

entryPoints: config.entryPoints,

// Hide the documentation generator footer.
Expand All @@ -101,12 +84,8 @@ async function generate(config, logLevel, mdnDataPath)
kindSortOrder,

// Sets log level.
logLevel: config.logLevel ?? logLevel,

// New option in 0.24.8 required to render full navigation tree.
navigation: {
fullTree: true
},
// logLevel: config.logLevel ?? logLevel,
logLevel: LogLevel.Verbose,

// Output directory for the generated documentation.
out: config.out,
Expand All @@ -119,12 +98,12 @@ async function generate(config, logLevel, mdnDataPath)

// Only show the `inherited` filter.
visibilityFilters: {
inherited: true,
inherited: true
}
});
}, [new TSConfigReader()]);

// Create TypeDoc ProjectReflection.
const project = app.convert();
const project = await app.convert();

// Generate documentation and URL map.
if (project)
Expand Down Expand Up @@ -159,7 +138,6 @@ const kindSortOrder = [
'Function',
'Accessor',
'Method',
'ObjectLiteral',
'Parameter',
'TypeParameter',
'TypeLiteral',
Expand Down

0 comments on commit 4fdd0be

Please sign in to comment.