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

@category doc over class props, causes constructor to be categorized as "Other" #661

Closed charlesLoder closed 3 months ago

charlesLoder commented 3 months ago

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

This may not be a bug, per se, but the ergonomics of it feel a little off.

If the properties of a class have the @category tag, then the constructor is no longer given the heading "Constructors"; instead, it is under the heading "Other."

One possible workaround is to give the constructor the @category tag of @category Constructor, but it will cause the "Constructor" heading to alphabetically come after other categories (e.g. "Color"). So this isn't a fix.

See minimal example and run npm run docs, which also outputs the Typedoc json. The animalWithoutCategories.ts outputs the constructor under the right heading, and animalWithCategories.ts outputs the constructor under the heading of "Other".

TypeDoc configuration

{
  "plugin": ["typedoc-plugin-markdown"],
  "out": "./docs",
  "entryPoints": ["src/index.ts"]
}

Expected behavior

I expect that the Constructor would retain it's own unique heading, and be at the top of the page under headings like "Implements", which is not affected by alphabetical ordering. I would expect this given the importance of a constructor in a class.

tgreyuk commented 3 months ago

Thanks - will review and fix with next release.

tgreyuk commented 3 months ago

Should be fixed in typedoc-plugin-markdown@4.2.4.

charlesLoder commented 3 months ago

It works, thanks!