Typedoc: Link text doesn't become a link when using {@link X | Y}

Created on 13 May 2020  ·  9Comments  ·  Source: TypeStrong/typedoc

Search terms

link, link text

Expected Behavior

Something such as {@link MyClass | some other text} should show up as a link to MyClass but the text is "some other text"

Actual Behavior

Instead, the documentation just shows "{@link MyClass | some other text}" literally, not parsed.

Steps to reproduce the bug

The repo I'm working on https://github.com/stonet2000/dimensions

Just adding {@link MyClass | some other text} over a class and running the following command:

typedoc --theme ./theme/dimensions/ --mode modules --exclude ./src/Station/ --out docs ./src && touch ./docs/.nojekyll

My typedoc.json:

{
  "inputFiles": ["./src"],
  "mode": "modules",
  "out": "docs",
  "theme": "./theme/dimensions",
  "tsconfig": "./tsconfig.json",
  "exclude": ["./src/Station/**/*"],
  "target": "es5"
}

(I realize that I don't need all of those command line args)
My tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "outDir": "lib/",
    "sourceMap": true,
    "declaration": true,
    "allowJs": true,
    "esModuleInterop": true,
    "isolatedModules": true
  },
  "include": [
    "src/**/*"
  ],
  "exclude": [
    "node_modules",
    "docs",
    "lib",
    "examples",
    "templates",
    "src/Station/web/**/*",
    "src/Station/local/**/*"
  ]
}

Environment

  • Typedoc version: [email protected]
  • TypeScript version: 3.8.3
  • Node.js version: 12.16.1
  • OS: MacOS 10.13.6, High Sierra
bug

All 9 comments

I can't seem to get {@link Foo} working at all, @StoneT2000. Even without the extra text after the |.

I looked through your repo and noticed that you have a few regular {@link} tags w/out the extra text. Are those working ok for you? Or is it only the ones with the | and the extra text?

Oh sorry I gave a hypothetical example. Foo isn't a class or type or anything so it shouldn't work anyway?

In my repo, an example of a working {@link} tag is {@link Design} or {@link Agent}. Those definitely work. But suppose I wanted to write Agents and wanted that to link to the agent class, I tried {@link Agent | Agents} but that doesn't work. Thanks for the fast reply btw!

Fixed with 935e10a, should hopefully have a release later today, or at least by the end of the weekend.

@mjackson I just created https://typedoc.org/guides/link-resolution/, which should hopefully answer your question. If it doesn't, feel free to create a new issue

That's actually pretty clear! However, I did notice that in the commit 935310a, there was a comment that used "classes".NameInterface. It would be great if there's documentation on how to reference a symbol across different paths explicitly if that's possible

I think the doc page linked above covers that, did I miss something?

Maybe i missed it but i can’t find documentation about using the “” quotes to specify a file path directly to where we want to have typedoc search for symbols first

Looks like you're right, I thought I mentioned it. Adding this under the structure block:

This structure can be used to determine the fully qualified name of each
reflection. The fully qualified name of a reflection is the name of the
reflection and all its parents, joined with .; that is, the fully qualified
name of the seeds property is "index".Apple.seeds. You can use the fully
qualified name to link to symbols defined in other source files without relying
on the slow fourth step of the algorithm used to resolve links.

v0.17.7 released with this :)

Was this page helpful?
0 / 5 - 0 ratings