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
697 stars 173 forks source link

TypeDoc generates broken links for `{@linkcode ...}` comments #482

Closed mrousavy closed 1 month ago

mrousavy commented 10 months ago

Hey! Thanks for this amazing plugin, I use TypeDoc to generate API documentation for react-native-vision-camera! ❤️

I am using {@linkcode } blocks, (see code here), but for some reason the output links are broken:

Exhaustive list of all broken links found
-> linking to CameraDeviceFormat.md#maxfps (resolved as: /docs/api/interfaces/CameraDeviceFormat.md)

Screenshot 2023-10-10 at 18 15 16

Is there any way to configure that? Or am I using {@linkcode ...} wrong?

mrousavy commented 10 months ago

(The problem is the .md suffix, it needs to be generated without .md, then it's a valid link)

mrousavy commented 10 months ago

The issue occurs only when there's many {@linkcode ...} statements close by, weirdly if I add text inbetween those links it compiles fine...

tgreyuk commented 10 months ago

So I have done a bit of digging and {@linkcode} is parsing correctly but there does seem to be a Docusaurus bug in resolving broken links when a link is immediately followed by a parenthesis.

broken: [label](page.md#anchorName) (see [label](page.md#anchorName))

ok: see ([label](page.md#anchorName))

ok: [label](page.md#anchorName) - (see [label](page.md#anchorName))

mrousavy commented 9 months ago

Interesting! Thanks for your insights, I guess this should be reported in the Docusaurus repo then?

tgreyuk commented 9 months ago

I guess this should be reported in the Docusaurus repo then?

Yes I think so - I'll do a bit more investigation and raise a ticket.

mrousavy commented 9 months ago

Awesome, thank you I appreciate it! 🙏

bo-carey commented 9 months ago

@tgreyuk - I am also experiencing this bug. Have you made a ticket?

tgreyuk commented 9 months ago

Thanks @bo-carey i was just looking at this and i notice you have already raised a ticket. I am linking to it here as a reference - https://github.com/facebook/docusaurus/issues/9518 .

bo-carey commented 9 months ago

@tgreyuk thanks for that, Tom!

tgreyuk commented 1 month ago

Have tested and I can confirm that this issue has been fixed in Docusaurus 3.4. https://github.com/facebook/docusaurus/pull/10168.