typedoc
typedoc copied to clipboard
External host
Search Terms
host symbol
Problem
External symbols appearing in the documentation can currently only have their URL customized in limited form. For instance, you're currently able to specify which is the URL of a module's specific item (externalSymbolLinkMappings), but aren't able to do this in a generalized way.
Suggested Solution
For online TypeDoc host services, offer the following option:
{
"externalHost": "https://registry.dev/{package}/{version}"
}
This way, all external symbols will be affected by this URL, and TypeDoc will replace {package} and {version} according to what package + version contain the external symbol.
This is infeasible to do in a generic way as TypeDoc generated sites can use the router option to customize how their sites are generated. Furthermore, it requires knowing how TypeDoc converted names under that package as some tags (e.g. @enum, @interface, @class, @namespace) can change how TypeDoc ends up converting the docs.
Furthermore, there isn't a typedoc-hosted collection of API docs. A couple of experiments for this have been tried, but they never took off, and projects generally include more than just TypeDoc generated output on their sites.
If you know how a given project is resolved, it is easy to write a plugin which uses converter.addUnknownSymbolResolver to resolve symbols for one or more packages, you could implement your proposed option easily with that method.