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

Customize the order of doc comment block tag rendering #2285

Closed
Oblarg opened this issue May 19, 2023 · 4 comments
Closed

Customize the order of doc comment block tag rendering #2285

Oblarg opened this issue May 19, 2023 · 4 comments
Labels
enhancement Improved functionality
Milestone

Comments

@Oblarg
Copy link

Oblarg commented May 19, 2023

Search Terms

block tags @remarks @example @param

Problem

Currently there seems to be no way to force the "parameters" block to render above the "examples" block. This is troublesome if the @example block is lengthy.

Suggested Solution

Add an option to mandate the rendering order (top-to-bottom) of the existing block tag sections. This could be represented by a simple string array.

@Oblarg Oblarg added the enhancement Improved functionality label May 19, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 29, 2023

This is unimplementable given TypeDoc's current reflection architecture. Comments on parameters are not contained within the comment for the signature, but on each parameter.

That said, TypeDoc really should render the comment summary, then parameters + return type, then the remaining block tags, which would make this better.

@Oblarg
Copy link
Author

Oblarg commented May 29, 2023

If it's possible to change the default rendering order, why is it not possible to make that rendering order depend on some literal array in the global options?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 29, 2023

It's possible for everything except parameters + returns -- unless an incredible amount of hackery is done, the parameters and returns sections aren't kept in the same collection as the block tags.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 29, 2023

Changelog entry:

image

@Gerrit0 Gerrit0 added this to the v0.24.8 milestone Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality
Projects
None yet
Development

No branches or pull requests

2 participants