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
704 stars 175 forks source link

Adding support for typedoc-plugin-coverage #573

Closed SalahAdDin closed 7 months ago

SalahAdDin commented 7 months ago

Hello again,

Right now we are testing the coverage plugin for creating a badge showing the documentation coverage on the API documentation; unfortunately, it does not work: image

However, the badge is created as an svg file: image

It should be enough to automatically add it to the intro.md file to show it.

What do you think?

tgreyuk commented 7 months ago

I think that plugin simply creates the SVG. Where exactly would you want it placed? Underneath the API heading on index page only?

SalahAdDin commented 7 months ago

I think that plugin simply creates the SVG. Where exactly would you want it placed? Underneath the API heading on index page only?

Place in the index would be enough, but if it is added to the API heading, I would be amazing!

tgreyuk commented 7 months ago

Because the coverage-plugin doesn't currently let you configure the path, you need to copy the badge to your static directory and then you can reference it using a hook with a custom plugin.

I have added an example stackblitz of this being done:

https://stackblitz.com/~/github.com/tgreyuk/docusaurus-plugin-typedoc-example

This is the code for the custom plugin:

https://github.com/tgreyuk/docusaurus-plugin-typedoc-example/blob/main/docs-website/typedoc-copy-coverage.mjs

You just reference it in the plugins option lilke this:

plugin: ["typedoc-plugin-coverage", "./typedoc-copy-coverage.mjs"],
SalahAdDin commented 7 months ago

@tgreyuk The plugin has type issues: image

Could you check it?

tgreyuk commented 7 months ago

Can you make sure you are using the latest version of all plugins please?

SalahAdDin commented 7 months ago

Can you make sure you are using the latest version of all plugins, please?

Yeah, they are in the latest version: image

tgreyuk commented 7 months ago

Yeah, they are in the latest version:

please update to 4.0.0-next.53

SalahAdDin commented 7 months ago

Yeah, they are in the latest version:

please update to 4.0.0-next.53

Done, it works!