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
689 stars 172 forks source link

Invalid Invalid Link with `outputFileStrategy: 'modules'` and `flattenOutputFiles: true` #616

Closed lorenzolewis closed 1 month ago

lorenzolewis commented 1 month ago

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

When using the TypeDoc config below it will result in invalid internal links.

For example, if this generated file exists: Namespace.dpi.md and you have a link to an item called logicalposition within itself, it will generate this link: namespaces/dpi.md#logicalposition.

I would expect this link to instead be namespace.dpi.md#logicalposition (notice the removal of the trailing s in namespaces and using a . instead of a /.

TypeDoc configuration

{
    // TypeDoc options
    // https://typedoc.org/options/
    githubPages: false,
    hideGenerator: true,
    readme: 'none',
    logLevel: 'Warn',
    parametersFormat: 'table',
    // typedoc-plugin-markdown options
    outputFileStrategy: 'modules',
    flattenOutputFiles: true,
    entryFileName: 'index.md',
    hidePageHeader: true,
    hidePageTitle: true,
    hideBreadcrumbs: true,
    useCodeBlocks: true,
    propertiesFormat: 'table',
    typeDeclarationFormat: 'table',
    useHTMLAnchors: true,
};

Expected behavior

See above. It seems that the option for flattenOutputFiles is not being taken into account.

tgreyuk commented 1 month ago

Thank you. Fixed in typedoc-plugin-markdown@4.0.2.

lorenzolewis commented 1 month ago

Perfect! Pulled the latest and can confirm it's working as expected!