Skip to content

wpazderski/tmp-typedoc-bug

Repository files navigation

tmp-typedoc-bug

An example project to reproduce TypeDoc bug with links in "throws"

Usage

Install dependencies and run examples:

npm ci
npm run examples

You can also run a single example (example1, example2, example3):

npm run example1

Examples

example1

  • Source: ./example1/
  • Output: ./docs1/
  • Config: ./typedoc-example1.config.js
  • typedoc result:
[warning] Failed to resolve link to "ImportedError" in comment for example/Example.Example.importedError
[info] html generated at ./docs1
[warning] Found 0 errors and 1 warnings
  • Screenshot of generated Example class: ./example1.png
    • Only 5 of 6 links to *Error are present
    • ImportedError that was placed right after @throws is just plain text, not a link

example2

  • Differences compared to example1:
    • main.ts was deleted - only files inside example/ dir are present
  • Source: ./example2/
  • Output: ./docs2/
  • Config: ./typedoc-example2.config.js
  • typedoc result:
[info] html generated at ./docs2
  • Screenshot of generated Example class: ./example2.png
    • All 6 links to *Error are present

example3

  • Differences compared to example1:
    • main.ts was replaced with index.ts that re-exports everything from example/ dir
    • TypeDoc config was changed to use the index.ts file as entryPoint, entryPointStrategy option was removed
  • Source: ./example3/
  • Output: ./docs3/
  • Config: ./typedoc-example3.config.js
  • typedoc result:
[info] html generated at ./docs3
  • Screenshot of generated Example class: ./example3.png
    • All 6 links to *Error are present

Summary

It looks like if the following conditions are met:

  • entryPointStrategy is set to expand,
  • any *.ts file is present in a directory above the target file (Example.ts in this case), but inside the directory specified in entryPoints

then the link that occurs right after @throws is rendered as plain text instead of a link (for imported classes):

/**
 * {@link RendersAsLink}
 * @throws {@link RendersAsPlainText} - {@link RendersAsLink}
 */

About

An example project to reproduce TypeDoc bug with links in "throws"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages