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 improve the formatting for types? #456

Closed
ziad-saab opened this issue Aug 1, 2023 · 5 comments
Closed

How to improve the formatting for types? #456

ziad-saab opened this issue Aug 1, 2023 · 5 comments
Labels
next Fix available in the '@next' release

Comments

@ziad-saab
Copy link

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

tgreyuk commented Aug 1, 2023

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

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

@tgreyuk
Copy link
Member

tgreyuk commented Aug 10, 2023

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 tgreyuk added the next Fix available in the '@next' release label Aug 10, 2023
@ziad-saab
Copy link
Author

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

tgreyuk commented May 3, 2024

typedoc-plugin-markdown@4.0.0

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

@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

2 participants