sourceLinkTemplate option is not supported
Closed this issue · 2 comments
What package is the bug related to?
typedoc-plugin-markdown
Describe the issue
I use this plugin with typedoc in a monorepo with 50 packages to generate API reference docs for them. The API reference is generated in PRs, and deployed on each push to the main
branch.
For each symbol in the generated docs, this plugin emits source links for them pointing to Github. The link includes the commit hash, which changes with each commit. This causes PRs to have massive diffs, just because the commit hash changed.
I want to work around this behaviour with the sourceLinkTemplate
option. I want to use a template that points to the main
branch instead of the latest commit hash (e.g. https://github.com/<org>/<repo>/blob/main/{path}#line={line}
).
The plugin does not seem to respect this option. Can we please fix this behaviour?
TypeDoc configuration
{
"$schema": "https://typedoc-plugin-markdown.org/schema.json",
"entryPoints": ["packages/*"],
"entryPointStrategy": "packages",
"includeVersion": false,
"cleanOutputDir": true,
"out": "./apps/docs/src/pages/api-reference",
"plugin": ["typedoc-plugin-markdown"],
"hideBreadcrumbs": true,
"hidePageHeader": true,
"entryFileName": "index",
"sourceLinkTemplate": "https://github.com/<org-name>/<repo-name>/blob/main/{path}#line={line}"
}
Expected behavior
The generated source link should respect the supplied template.
Hello. This is more of a TypeDoc question that a plugin question, however this is supported but the config needs to be set in the config file for each package. TypeDoc 0.26 will be introducing a packageOptions
option to address this very issue. TypeStrong/typedoc#2523
Thanks! Adding config at the package level fixed my issue.