Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to export interface as a table #403

Closed
ccnwjsqdfky55 opened this issue Mar 14, 2023 · 11 comments
Closed

How to export interface as a table #403

ccnwjsqdfky55 opened this issue Mar 14, 2023 · 11 comments
Labels
next Fix available in the '@next' release

Comments

@ccnwjsqdfky55
Copy link

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

@tgreyuk
Copy link
Member

tgreyuk commented Mar 31, 2023

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

@tgreyuk
Copy link
Member

tgreyuk commented Apr 18, 2023

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 tgreyuk added the next Fix available in the '@next' release label Apr 18, 2023
@ccnwjsqdfky55
Copy link
Author

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
Copy link
Author

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

@tgreyuk
Copy link
Member

tgreyuk commented Apr 19, 2023

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

@fabrizio-vitale-deltatre

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
Copy link
Member

tgreyuk commented May 13, 2023

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

@CoderIllusionist
Copy link

CoderIllusionist commented May 31, 2023

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
Copy link
Member

tgreyuk commented May 31, 2023

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

@CoderIllusionist
Copy link

@tgreyuk Thanks, that did it for me

@tgreyuk
Copy link
Member

tgreyuk commented May 3, 2024

typedoc-plugin-markdown@4.0.0

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

@tgreyuk tgreyuk closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next Fix available in the '@next' release
Projects
None yet
Development

No branches or pull requests

4 participants