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
697 stars 173 forks source link

`@group` is not respected when placed over a `type` and `allReflectionsHaveOwnDocument` is `false` #448

Closed HarelM closed 3 months ago

HarelM commented 1 year ago

I'm migrating MapLibre project documentation site to use TSDoc comments + TypeDoc + this plugin + mkdocs. When I generate the site with out using this plugin I get the following results: image This is how the site looks - note the Event Related group I created image After using this plugin I get the following (missing types, variables, etc): image And the Event Related is moved down and gets badly formmated: image

The data can be found in the following repo - this is the commit I'm currently on: https://github.com/maplibre/maplibre-gl-js/tree/0f5934a0f63db2674eae9121059fbf2da2a64f57

I'm not sure what causes this, probably some bad comments structure...

birkskyum commented 1 year ago

I can see that all the data that as .html was in "types" now is inside of the modules/maplibregl.md

HarelM commented 1 year ago

I'm not sure, but this was from day 1, so it might be the way this plugin works, IDK...

birkskyum commented 1 year ago

@HarelM , I've found something. When I change "Event Related" to "EventRelated" both in the typedoc.json and in the @group EventRelated in the evented.ts (but not in events.ts) it appeared in the intro

birkskyum commented 1 year ago

Found out some more. It's not the space in the "event related" that is the issue. It's because things break when a @group is added to a type, like in the event.ts.

If I make a new group called "Event Related 2" and add that to only classes (shown in the image), then they appear. If I add it to a type from event.ts as well (like MapLayerMouseEvent), things break.

Screenshot 2023-07-06 at 14 21 11
HarelM commented 1 year ago

I think the following flag fixes some things, not sure yet: allReflectionsHaveOwnDocument. This creates a document for each type as well as each class. It might be a workaround for this issue.

birkskyum commented 1 year ago

That is great! It appears the now-simplified module page has the potential to replace the intro. http://0.0.0.0:8000/maplibre-docs-test/API/modules/maplibregl/

birkskyum commented 1 year ago

Maybe the title of this issue should be renamed to indicate types are not included in the @group when allReflectionsHaveOwnDocument = false, to narrow it down;

HarelM commented 1 year ago

True, but this is the default... I'll see if I can fix the title.

tgreyuk commented 1 year ago

@HarelM Thanks for raising the issue. My main effort at the moment is to concentrate on the next version of this plugin which actually does address this issue - typedoc-plugin-markdown@next. I'd be very happy to incorporate anything into this version. Updated options can be found in the readme https://github.com/tgreyuk/typedoc-plugin-markdown/blob/next/packages/typedoc-plugin-markdown/README.md .

HarelM commented 1 year ago

Thanks for the info! I'll wait patiently for it to be released :-) I'm also looking for the removal of the kind prefix which I see you have added, so I'll wait for this version to come out. Feel free to test the plugin with my repo, it has all sorts of edge cases I guess...

tgreyuk commented 3 months ago

typedoc-plugin-markdown@4.0.0

HarelM commented 3 months ago

Thanks for the update! I'll take the new version for a ride and see how it behaves. Thanks for all the time invested in this!