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

How to improve the formatting for types?

Open ziad-saab opened this issue 1 year ago • 4 comments

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!

ziad-saab avatar Aug 01 '23 17:08 ziad-saab

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

tgreyuk avatar Aug 01 '23 22:08 tgreyuk

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

ziad-saab avatar Aug 02 '23 11:08 ziad-saab

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

tgreyuk avatar Aug 10 '23 21:08 tgreyuk

@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?

ziad-saab avatar Sep 15 '23 19:09 ziad-saab

[email protected]

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

tgreyuk avatar May 03 '24 16:05 tgreyuk