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

Bug: When `entryPointStrategy` is set to `expand`, docusaurus complains about broken links #486

Closed lengors closed 9 months ago

lengors commented 10 months ago

I assume this is a bug, but when I set entryPointStrategy to expand, I get the following error when building docusaurus:

[ERROR] Unable to build website for locale en.
[ERROR] Error: Docusaurus found broken links!

Please check the pages of your site in the list below, and make sure you don't reference any path that does not exist.
Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.

Exhaustive list of all broken links found:

- On source page path = /docs/api/core/shutdown/:
   -> linking to null (resolved as: /docs/api/core/shutdown/null)

- On source page path = /docs/api/test/:
   -> linking to null (resolved as: /docs/api/test/null)

    at throwError (C:\Users\pedro\Projects\engine-test-gh-pages\node_modules\@docusaurus\logger\lib\index.js:76:11)
    at handleBrokenLinks (C:\Users\pedro\Projects\engine-test-gh-pages\node_modules\@docusaurus\core\lib\server\brokenLinks.js:153:47)
    at async buildLocale (C:\Users\pedro\Projects\engine-test-gh-pages\node_modules\@docusaurus\core\lib\commands\build.js:186:5)
    at async tryToBuildLocale (C:\Users\pedro\Projects\engine-test-gh-pages\node_modules\@docusaurus\core\lib\commands\build.js:41:20)
    at async mapAsyncSequential (C:\Users\pedro\Projects\engine-test-gh-pages\node_modules\@docusaurus\utils\lib\jsUtils.js:34:24)
    at async Command.build (C:\Users\pedro\Projects\engine-test-gh-pages\node_modules\@docusaurus\core\lib\commands\build.js:76:21)

I've tried both with latest channel:

And next channel:

Same thing happens in both cases. I like that next channel separates functions and what not, even when not using the expand strategy, but would still prefer expand, but I don't know if it's possible to fix this issue.

tgreyuk commented 10 months ago

Thanks @lengors - would you be able to share your config on a public repo?

lengors commented 10 months ago

@tgreyuk Yes, I can. Here is the repository: https://github.com/lengors/issue-demo

One thing to note is that when setting readme to "none", the issue doesn't occur. My guess is that because without it, the markdown plugin doesn't generate a module.md which I believe is what's causing the conflict with modules/index.md.

tgreyuk commented 9 months ago

This will no longer throw an error in lastest next version.

lengors commented 9 months ago

This will no longer throw an error in lastest next version.

Awesome. Thank you. By the way, v3 of Docusaurus was released yesterday, I haven't tested to see if the plugin is compatible atm or not, but do you have any plans to officially support it?

tgreyuk commented 9 months ago

Yes - if you use the latest version Docusaurus v3 should be supported (obviouslly let me know if any issues though).