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

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

Closed lorenzolewis closed 6 months ago

lorenzolewis commented 6 months 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 6 months ago

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

lorenzolewis commented 6 months ago

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