typedoc-plugin-markdown icon indicating copy to clipboard operation
typedoc-plugin-markdown copied to clipboard

How to export interface as a table

Open ccnwjsqdfky55 opened this issue 2 years ago • 10 comments
trafficstars

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

ccnwjsqdfky55 avatar Mar 14 '23 06:03 ccnwjsqdfky55

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

tgreyuk avatar Mar 31 '23 22:03 tgreyuk

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.

tgreyuk avatar Apr 18 '23 22:04 tgreyuk

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 avatar Apr 19 '23 02:04 ccnwjsqdfky55

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

ccnwjsqdfky55 avatar Apr 19 '23 02:04 ccnwjsqdfky55

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

tgreyuk avatar Apr 19 '23 07:04 tgreyuk

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?

@fabrizio-vitale-deltatre apologies - the option typeDeclarationFormat is available again in [email protected]

tgreyuk avatar May 13 '23 22:05 tgreyuk

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'

CoderIllusionist avatar May 31 '23 15:05 CoderIllusionist

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

tgreyuk avatar May 31 '23 15:05 tgreyuk

@tgreyuk Thanks, that did it for me

CoderIllusionist avatar Jun 06 '23 09:06 CoderIllusionist

[email protected]

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

tgreyuk avatar May 03 '24 17:05 tgreyuk