Skip to content

Conversation

@crowlKats
Copy link
Member

This PR adds a new jsdoc tag: @priority.
It takes a number value, and acts like z-index in css does: a bigger number means it has higher priority, 0 same as unset and negative lower priority.

The priority affects in what order symbols are displayed in symbol lists in the HTML renderer, with greater priority showing up first.
This is especially useful for JSR, where there may be some exports you want to prioritize (or "feature").

@crowlKats crowlKats requested review from dsherret and kt3k December 25, 2025 14:26

match (p1, p2) {
(Some(p1), Some(p2)) => p1.cmp(p2),
(Some(p1), None) if p1 == &0 => Ordering::Equal,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to handle None being equal to 0

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful for organizing API docs page (especially in JSR) in more reasonable form. I think this is worth trying. LGTM

@kt3k
Copy link
Member

kt3k commented Dec 26, 2025

BTW do we document what tags are supported in deno doc or in JSR in somewhere?

@crowlKats
Copy link
Member Author

@crowlKats crowlKats merged commit 5e8fe51 into main Dec 27, 2025
7 checks passed
@crowlKats crowlKats deleted the jsdoc-priority branch December 27, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants