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

How to improve the formatting for types? #456

Closed ziad-saab closed 3 months ago

ziad-saab commented 1 year ago

The output of typedoc-plugin-markdown can sometimes be very difficult to read, especially when compared to its HTML counterpart. Here's an example of HTML and Markdown outputs from the same codebase:

HTML: https://metamask.github.io/keyring-api/latest/variables/KeyringAccountStruct.html Markdown: https://docs.metamask.io/zs/keyring-doc/snaps/reference/keyring-api/modules/#keyringaccountstruct

The main difference being that the HTML output has one entry per line, whereas the Markdown output reads all on the same line, making it almost useless.

Thank you!

tgreyuk commented 1 year ago

Hi,

Markdown will ignore a single line break and trying to create a double line break won't work either. What I have been looking at is an option to wrap this kind of thing in a code block which will produce this kind of output:

Screenshot 2023-08-01 at 22 59 39
ziad-saab commented 1 year ago

yes that would be perfect! if you can point me to a place in the code i can take a stab at it!

tgreyuk commented 1 year ago

yes that would be perfect! if you can point me to a place in the code i can take a stab at it!

So this option is already available in next version so might not be worth the effort .

Options name is identifiersAsCodeBlocks

https://github.com/tgreyuk/typedoc-plugin-markdown/tree/next/packages/typedoc-plugin-markdown

ziad-saab commented 11 months ago

@tgreyuk the new version with identifiersAsCodeBlocks looks much better! Here's an example:

image

Do you reckon anything can be done about the "Return Type" part?

tgreyuk commented 3 months ago

typedoc-plugin-markdown@4.0.0

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