-
-
Notifications
You must be signed in to change notification settings - Fork 748
Description
Search Terms
Allow extending of the blockTags (and maybe inlineTags and others too) array.
Problem
Using blockTags config option it's already possible to overwrite the default blockTags definition. But extending them is currently not possible.
Of cause you could just copy&paste the default blockTags but it doesn't feel right and needs to be checked/updated on each TypeDoc update.
I'm using TypeDoc as node module by calling
import TypeDoc from 'typedoc';
const typeDocApp = await TypeDoc.Application.bootstrapWithPlugins({
// ...
blockTags: [
// ...
],
});
//...The I saw that the default blockTags are defined in:
typedoc/src/lib/utils/options/tsdoc-defaults.ts
Lines 16 to 39 in c1fb5bd
| export const blockTags = [ | |
| ...tsdocBlockTags, | |
| "@author", | |
| "@callback", | |
| "@category", | |
| "@categoryDescription", | |
| "@default", | |
| "@document", | |
| "@group", | |
| "@groupDescription", | |
| "@import", | |
| "@inheritDoc", | |
| "@jsx", | |
| "@license", | |
| "@module", | |
| "@prop", | |
| "@property", | |
| "@return", | |
| "@satisfies", | |
| "@since", | |
| "@template", // Alias for @typeParam | |
| "@type", | |
| "@typedef", | |
| ] as const; |
Trying to import them directly from the dist path fails with ERR_PACKAGE_PATH_NOT_EXPORTED:
import { blockTags } from 'typedoc/dist/lib/utils/options/tsdoc-defaults.js';
// Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/lib/utils/options/tsdoc-defaults.js' is not defined by "exports" in /home/[...]/node_modules/typedoc/package.json imported from /home/[...]/scripts/docs.tsSuggested Solution
Export the default blockTags (and maybe also the other default tags) to allow to import and extend them.
Example of possible use:
import TypeDoc from 'typedoc';
const typeDocApp = await TypeDoc.Application.bootstrapWithPlugins({
// ...
blockTags: [
...TypeDoc.defaults.blockTags,
'@myCustomTag',
],
});
//...