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

feat: allow to use x-tagGroups extension to define tree structure #2603

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

weyert
Copy link
Contributor

@weyert weyert commented Jun 24, 2024

Allow to use the x-tagGroups and x-displayName vendor extensions to define the structure of table of contents

fixes #1390

Elements Default PR Template

In general, make sure you have: (check the boxes to acknowledge you've followed this template)

Allow to use the `x-tagGroups` and `x-displayName` vendor extensions to
define the structure of table of contents
Copy link

netlify bot commented Jun 24, 2024

Deploy Preview for stoplight-elements ready!

Name Link
🔨 Latest commit fc7b9ac
🔍 Latest deploy log https://app.netlify.com/sites/stoplight-elements/deploys/66be1eec5cfb930008a82def
😎 Deploy Preview https://deploy-preview-2603--stoplight-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 24, 2024

Deploy Preview for stoplight-elements-demo ready!

Name Link
🔨 Latest commit fc7b9ac
🔍 Latest deploy log https://app.netlify.com/sites/stoplight-elements-demo/deploys/66be1eec431f8e0008c39411
😎 Deploy Preview https://deploy-preview-2603--stoplight-elements-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

…ents into add-taggroups-support

* 'add-taggroups-support' of github.com:weyert/elements:
  feat: default boolean schema value is not shown in parameters dropdown (stoplightio#2600)
@weyert weyert marked this pull request as ready for review June 24, 2024 19:24
@weyert weyert requested a review from a team as a code owner June 24, 2024 19:24
@mnaumanali94
Copy link
Contributor

@weyert Can you provide an explanation of what this does and some documentation please.

@weyert
Copy link
Contributor Author

weyert commented Jul 19, 2024

@weyert Can you provide an explanation of what this does and some documentation please.

@mnaumanali94 If the x-tagGroups-extension exists in the specification it will go to a different code path which uses the extension as defined by Redocly to generate the structure. This should fix issue #1390

See screenshot:
CleanShot 2024-07-19 at 19 58 26@2x

or see: https://deploy-preview-2603--stoplight-elements.netlify.app/?path=/story/public-api--with-tag-groups

The relevant vendor extension definition in the spec:

{
"tags": [
     {
       name: 'Todos',
       'x-displayName': 'To-dos',
     },
     {
       name: 'Retrieval',
       'x-displayName': 'Retrieve To-do Items',
     },
     {
       name: 'Management',
       'x-displayName': 'Add/remove To-do Items',
     },
],
'x-tagGroups': [
     {
       name: 'Todos',
       tags: ['Retrieval', 'Management'],
     },
]
}

@mnaumanali94
Copy link
Contributor

This doesn't solve the problem of showing description for tags? Did you intend to add that too?

@weyert
Copy link
Contributor Author

weyert commented Jul 25, 2024

@mnaumanali94 It allows you use a different text for a tag in the site navigation.

I am not sure what intended use case of showing a description alongside the tag name is.

@mnaumanali94 mnaumanali94 self-requested a review August 16, 2024 10:57
@mnaumanali94 mnaumanali94 added the t/to-review To be reviewed by the team label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/to-review To be reviewed by the team triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for x-tagGroups
3 participants