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
723 stars 177 forks source link

publicPath does not work with URL #688

Closed f0x52 closed 1 month ago

f0x52 commented 1 month ago

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

When configuring publicPath with an url (like the docs suggest), the internal call to path.resolve() normalizes the // in the http(s):// protocol bit to just /, resulting in broken links

[Reference](https:/example.com/README.md#reference)

I think https://github.com/typedoc2md/typedoc-plugin-markdown/issues/621 was about the same problem

TypeDoc configuration

{
  "publicPath": "https://example.com"
}

Expected behavior

Currently publicPath has the correct behavior for setting a path prefix, but should preserve the protocol when a full URL is given

f0x52 commented 1 month ago

Typedoc also has options for hostedBaseUrl and useHostedBaseUrlForAbsoluteLinks but I believe those are never used for markdown output?

tgreyuk commented 1 month ago

Thankss. This should be fixed in typedoc-plugin-markdown@4.2.8

Typedoc also has options for hostedBaseUrl and useHostedBaseUrlForAbsoluteLinks but I believe those are never used for markdown output?

This is correct. These options were introduced after the publicPath plugin option was implemented. I have considered supporting but I think the single option is more simplistic. Have updated the docs to reflect this.