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
714 stars 176 forks source link

How to export interface as a table #403

Closed ccnwjsqdfky55 closed 5 months ago

ccnwjsqdfky55 commented 1 year ago

I find the table form is more beautiful, can I output the definition of interface as a table form now?

tgreyuk commented 1 year ago

Not yet - but will add an option for that in next release.

tgreyuk commented 1 year ago

This is a now available as an experimental option is in the next pre-release:

--propertiesFormat
Specify the render style of properties groups for Interfaces and Classes. Expected values [List, Table].

npm install typedoc-plugin-markdown@next

--propertiesFormat Table

Feel free to try it out.

ccnwjsqdfky55 commented 1 year ago

My Version Information "typedoc": "^0.23.24", "typedoc-plugin-markdown": "4.0.0-next.7",

I get the following error

TypeDoc exiting with unexpected error: TypeError: typedoc_1.ReflectionKind.singularString is not a function

ccnwjsqdfky55 commented 1 year ago

I use 4.0.0-next.6 and I don't have this problem

tgreyuk commented 1 year ago

Hi - sorry the TypeDoc required version is now >=0.24.0

fabrizio-vitale-deltatre commented 1 year ago

Piggybacking on this question, I've got the opposite problem:

I'd like to render types with an interface-like format.

My issue is that headings, lists and code blocks do not get rendered correctly when are defined in tsdoc coments of properties:

import type { A, B, C, } from './other'

type MyType = {
  /**
  * ```ts
  * // I'm a codeblock example
  * const t: MyType = { type: 2 } 
  * ```
  *
  */
  type: A | B | C
}

I've quickly skimmed next and it seems that there's an option typeDeclarationFormat that could be useful.

It doesn't seem implemented tho:

Screenshot 2023-05-08 at 16 14 51

Do you have an example on how to use these format options?

tgreyuk commented 1 year ago

@fabrizio-vitale-deltatre apologies - the option typeDeclarationFormat is available again in docusaurus-plugin-typedoc@1.0.0-next.9

CoderIllusionist commented 1 year ago

Can we use --propertiesFormat with docusaurus-plugin-typedoc ?

Edit: tried npm install typedoc-plugin-markdown@next, but getting a [ERROR] Error: Cannot find module 'typedoc-plugin-markdown/dist/groups'

tgreyuk commented 1 year ago

@CoderIllusionist you will also need docusaurus next docusaurus-plugin-typedoc@next

CoderIllusionist commented 1 year ago

@tgreyuk Thanks, that did it for me

tgreyuk commented 5 months ago

typedoc-plugin-markdown@4.0.0

https://typedoc-plugin-markdown.org/docs/options#propertiesformat