Closed favna closed 2 years ago
Thanks for detailed description. Fix in typedoc-plugin-markdown@3.11.4
Hi there, I can confirm the feature is there, however it's not entirely working well just yet. Running docusaurus start
works, but when trying to run docusaurus build
which does broken link checking I get the following:
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/Documentation/api-framework/classes/SapphireClient:
-> linking to %5B%60GuildPreview%60%5D(https://discord.js.org/#/docs/main/stable/class/GuildPreview)%5C (resolved as: /docs/Documentation/api-framework/classes/%5B%60GuildPreview%60%5D(https://discord.js.org/)
-> linking to %5B%60GuildTemplate%60%5D(https://discord.js.org/#/docs/main/stable/class/GuildTemplate)%5C (resolved as: /docs/Documentation/api-framework/classes/%5B%60GuildTemplate%60%5D(https://discord.js.org/)
-> linking to %5B%60Widget%60%5D(https://discord.js.org/#/docs/main/stable/class/Widget)%5C (resolved as: /docs/Documentation/api-framework/classes/%5B%60Widget%60%5D(https://discord.js.org/)
-> linking to %5B%60Invite%60%5D(https://discord.js.org/#/docs/main/stable/class/Invite)%5C (resolved as: /docs/Documentation/api-framework/classes/%5B%60Invite%60%5D(https://discord.js.org/)
-> linking to %5B%60Sticker%60%5D(https://discord.js.org/#/docs/main/stable/class/Sticker)%5C (resolved as: /docs/Documentation/api-framework/classes/%5B%60Sticker%60%5D(https://discord.js.org/)
-> linking to %5B%60Webhook%60%5D(https://discord.js.org/#/docs/main/stable/class/Webhook)%5C (resolved as: /docs/Documentation/api-framework/classes/%5B%60Webhook%60%5D(https://discord.js.org/)
- On source page path = /docs/Documentation/api-utilities/classes/sapphire_discord_js_utilities.LazyPaginatedMessage:
-> linking to %5B%60MessageComponentInteraction%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageComponentInteraction)%3C%60CacheType%60%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageComponentInteraction%60%5D(https://discord.js.org/)
-> linking to %5B%60MessageEmbed%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageEmbed)%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageEmbed%60%5D(https://discord.js.org/)
-> linking to %5B%60MessageEmbed%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageEmbed)%5B%5D%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageEmbed%60%5D(https://discord.js.org/)
- On source page path = /docs/Documentation/api-utilities/classes/sapphire_discord_js_utilities.MessagePrompterMessageStrategy:
-> linking to %5B%5B%60Message%60%5D(https://discord.js.org/#/docs/main/stable/class/Message)%3C%60boolean%60%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%5B%60Message%60%5D(https://discord.js.org/)
-> linking to %5B%60Message%60%5D(https://discord.js.org/#/docs/main/stable/class/Message)%3C%60boolean%60%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60Message%60%5D(https://discord.js.org/)
- On source page path = /docs/Documentation/api-utilities/classes/sapphire_discord_js_utilities.PaginatedFieldMessageEmbed:
-> linking to %5B%60MessageComponentInteraction%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageComponentInteraction)%3C%60CacheType%60%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageComponentInteraction%60%5D(https://discord.js.org/)
-> linking to %5B%60MessageEmbed%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageEmbed)%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageEmbed%60%5D(https://discord.js.org/)
-> linking to %5B%60MessageEmbed%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageEmbed)%5B%5D%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageEmbed%60%5D(https://discord.js.org/)
- On source page path = /docs/Documentation/api-utilities/classes/sapphire_discord_js_utilities.PaginatedMessage:
-> linking to %5B%60MessageComponentInteraction%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageComponentInteraction)%3C%60CacheType%60%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageComponentInteraction%60%5D(https://discord.js.org/)
-> linking to %5B%60MessageEmbed%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageEmbed)%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageEmbed%60%5D(https://discord.js.org/)
-> linking to %5B%60MessageEmbed%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageEmbed)%5B%5D%5C (resolved as: /docs/Documentation/api-utilities/classes/%5B%60MessageEmbed%60%5D(https://discord.js.org/)
- On source page path = /docs/Documentation/api-utilities/interfaces/sapphire_discord_js_utilities.PaginatedMessageActionContext:
-> linking to %5B%60MessageComponentInteraction%60%5D(https://discord.js.org/#/docs/main/stable/class/MessageComponentInteraction)%3C%60CacheType%60%5C (resolved as: /docs/Documentation/api-utilities/interfaces/%5B%60MessageComponentInteraction%60%5D(https://discord.js.org/)
at async tryToBuildLocale (F:\dev\sapphiredev\website\node_modules\@docusaurus\core\lib\commands\build.js:35:20)
at async mapAsyncSequencial (F:\dev\sapphiredev\website\node_modules\@docusaurus\utils\lib\index.js:263:24)
at async build (F:\dev\sapphiredev\website\node_modules\@docusaurus\core\lib\commands\build.js:71:25)
And when running docusaurus serve
despite that I see this on the website:
Strangely enough, the markdown for this code does appear to be valid markdown so my best guess is that Docusaurus is interpreting this markdown in a strange way. Maybe an escape character has to be added somewhere?
### fetchGuildPreview
▸ **fetchGuildPreview**(`guild`): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[`GuildPreview`](https://discord.js.org/#/docs/main/stable/class/GuildPreview)\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `guild` | `GuildResolvable` |
#### Returns
[`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[`GuildPreview`](https://discord.js.org/#/docs/main/stable/class/GuildPreview)\>
#### Inherited from
Client.fetchGuildPreview
#### Defined in
node_modules/discord.js/typings/index.d.ts:487
Bit annoying that this only shows when building the code so to make testing any potential fixes easier I've created a small repo which has the troublesome markdown files already generated: https://github.com/favna/animated-umbrella
The branch I linked in my initial bug report has also been updated with the latest version of the plugin.
thanks for the report back. that's interesting... i will take a look and report back.
So this is now appears to be fixed in typedoc-plugin-markdown@3.11.6
The fix was to add a space around the url inside the url parenthesis. ie: [Ref]( https://discord.js...... )
. I have no idea why Docusarus complains without it but it definately appears to fix the issue and I have successfully built your repo without errors. Let me know if the same for you. thanks..
Wasn't able to re-test this earlier but I can now confirm that this issue is resolved. Thank you for your awesome work! Closing this issue.
Hello there, I tried adding 2 plugins that offer third part symbols (https://github.com/TypeStrong/typedoc/blob/master/internal-docs/third-party-symbols.md) to my docusaurus generated markdown docs, however, they are simply not made into links. The plugins however work fine when generating typedoc's own HTML.
The typedoc plugins I'm trying to use are: https://github.com/Gerrit0/typedoc-plugin-mdn-links and https://github.com/sapphiredev/typedoc-plugin-djs-links
One of the docusaurus usages of the docusaurus-plugin-typedoc is:
As an example, using this plugin I get the following:
Whereas that same function in the typedoc generated html looks like this:
As you can see, the
Message
symbol is a link here.The matching markdown for the former is:
So the expected result would look like so, note the added link at
Message
:A preview deploy that shows the image above is available on Vercel: https://website-git-feat-add-third-party-symbols-sapphiredev.vercel.app/docs/Documentation/api-framework/namespaces/Resolvers#resolvechannel It is based on a branch on the repository where I'm using this plugin: https://github.com/sapphiredev/website/tree/feat/add-third-party-symbols (PR for branch: https://github.com/sapphiredev/website/pull/85)