Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{@link target} syntax doesn't work within included markdown files #2419

Open
personalizedrefrigerator opened this issue Oct 24, 2023 · 7 comments
Labels
bug Functionality does not match expectation
Milestone

Comments

@personalizedrefrigerator

Search terms

[[include:]], include, markdown, included markdown, .md, links, @link.

Expected Behavior

Links to symbols created with {@link symbolName} should be rendered in included markdown files.

Actual Behavior

{@link ...}s are rendered without formatting. For example,
screenshot: link not rendered properly

Steps to reproduce the bug

Sample repository.

Steps:

  1. Create a markdown file in a project's markdown include directory
  2. Include the markdown file in the README or a documentation comment with [[include:markdown-file-name-here.md]].
  3. Link to a symbol using the {@link symbolName} in the included markdown file.
  4. Link to the same symbol in a documentation comment

Environment

  • Typedoc version: 0.25.2
  • TypeScript version: 5.2.2
  • Node.js version: v18.13.0
  • OS: Ubuntu 23.10
@personalizedrefrigerator personalizedrefrigerator added the bug Functionality does not match expectation label Oct 24, 2023
@personalizedrefrigerator personalizedrefrigerator changed the title Markdown includes: {@link target} syntax doesn't work within included markdown files {@link target} syntax doesn't work within included markdown files Oct 24, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 28, 2023

Because of when include resolution happens, it isn't possible for links to be resolved. Include resolution would have to happen during conversion rather than during rendering for this to work.

I'm not entirely sure why include resolution was done there, that option was added before I started maintaining typedoc... it seems to me like it ought to happen during Converter.EVENT_RESOLVE, which would allow links to work. It also seems like this ought to take into account the source location of the file rather than using a hardcoded include directory... (maybe allowing the configuration of a baseUrl for non-relative imports like how node does...)

Changing any of this is breaking and would have to wait for 0.26, but an {@include ./file.md} could be implemented without a breaking change...

@dpthinh910
Copy link

Because of when include resolution happens, it isn't possible for links to be resolved. Include resolution would have to happen during conversion rather than during rendering for this to work.

I'm not entirely sure why include resolution was done there, that option was added before I started maintaining typedoc... it seems to me like it ought to happen during Converter.EVENT_RESOLVE, which would allow links to work. It also seems like this ought to take into account the source location of the file rather than using a hardcoded include directory... (maybe allowing the configuration of a baseUrl for non-relative imports like how node does...)

Changing any of this is breaking and would have to wait for 0.26, but an {@include ./file.md} could be implemented without a breaking change...

Hi @Gerrit0 , do you have any ETA for this feature? I have just upgraded my project to typedoc@0.25.4 and typescript@5 and there's no way I can use the @link tag inside the included markdown content

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 27, 2023

No, I avoid ETAs as they're a great way to disappoint people. The include option has also always felt like a bad hack to me as the content of those markdown files will not appear in VSCode.

@Dayday10
Copy link

Dayday10 commented Dec 27, 2023 via email

@dpthinh910
Copy link

dpthinh910 commented Dec 27, 2023

Thanks for sharing your opinion, a/w do you have any idea to achieve this feat? Before this upgrade i was using 0.17 and everything works fine with the monorepo-links plugin @Gerrit0

@Gerrit0 Gerrit0 modified the milestone: v0.26.0 Jan 12, 2024
@Dayday10
Copy link

Most creditable,needs tightened up ,take time to make it right.

@Gerrit0 Gerrit0 added this to the v0.26.0 milestone May 4, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 4, 2024

In 0.26, the --includes option has been replaced with a @document tag to add additional markdown pages to the generated site, and @link works there,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

4 participants