typedoc2md / typedoc-plugin-markdown

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
https://typedoc-plugin-markdown.org
MIT License
691 stars 171 forks source link

v4.1 removes relative link #645

Closed arantes555 closed 5 days ago

arantes555 commented 1 week ago

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

I am using typedoc with typedoc-plugin-markdown to generate .md documentation of a package.

In the entry point of this package, there is some header documentation for the module with @module. This gets exported to an index.md file.

This documentation contains a relative link to somewhere else in my documentation, outside of this package (the exact link is [here](../../api-ssks/index.md), if that is relevant somehow).

In v4.0.4 with typedoc v0.25.13, this link is correctly present in the index.md output.

In v4.1.0 with typedoc v0.26.0, the link is transformed into [here]() in the output.

TypeDoc configuration

{
  "entryPoints": ["./src/lib/main.ts"],
  "out": "../../doc-sdk/ssks-2mr",
  "plugin": ["typedoc-plugin-markdown", "typedoc-vitepress-theme"],
  "categoryOrder": ["*"],
  "excludeInternal": true,
  "disableSources": true,
  "hideBreadcrumbs": true,
  "hideGenerator": true,
  "sidebar": {
    "autoConfiguration": false
  },
  "githubPages": false,
  "readme": "none"
}

Expected behavior

The link should not be removed.

tgreyuk commented 1 week ago

Thanks for raising this. TypeDoc 0.26 treats relative links in a different way (that wasn't being handled). The relative link should now print as intended (available in typedoc-plugin-markdown@4.1.2).

However note that TypeDoc 0.26 attempts to resolve any relative links and output the resolved file to a media directory. Therefore if the link does not exist relative to the input source will will see an error like " [warning] The relative path ../../api-ssks/index.md is not a file and will not be copied to the output directory".

Just to clarify this behaviour (and warning) is not coming from this plugin but from TypeDoc core.

arantes555 commented 5 days ago

@tgreyuk thanks for your reactivity ! typedoc-plugin-markdown@4.1.2 does fix the problem for me, I am not getting any error from typedoc core.