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

Displaying the route's URI on the left panel with a description in the center pannel #1928

Closed
clement-estone opened this issue Mar 14, 2022 · 10 comments
Labels

Comments

@clement-estone
Copy link

Hi there!

I've been using Redoc for a while now, and I've been enjoying it a lot - it's really easy to use and has a very nice UI. Good job to the team!

Now I have a little problem with the left panel display: I'd like to display the routes' URI on the left, and when I click on a route in the center panel I'd like to get a description text.

Currently, if I use the description: property it also replaces the URI on the left panel, just like the screenshot shown on the repository's main page.

What I'd like to get is a left panel that looks like this:

image

But with a description text that appears when I click on the route.

Is that possible? I didn't find anything in the docs so I can't really figure out how to do this.

Thanks in advance for your answers!

@AlexVarchuk
Copy link
Collaborator

@clement-estone Hi! Thanks for the request.
Try to add sideNavStyle option. Example of using it you can find here.
also, you can use summary or operationId fields.

@clement-estone
Copy link
Author

Thanks, I'm currently producing an HTML file with redoc bundle <spec.yml>, where can I specify this option in the YAML document?

@AlexVarchuk
Copy link
Collaborator

AlexVarchuk commented Mar 14, 2022

You can pass it like options to RedocStandalone component.

<RedocStandalone
  spec={props.spec}
  options={{
    sideNavStyle: 'summary-only' or 'path-only'
  }}

@clement-estone
Copy link
Author

clement-estone commented Mar 14, 2022

I already saw I could do that but as I said, I'm not using any component, I'm just writing a plain, raw YAML file and generating the HTML from it.

So I can't (unless there's an option for this I didn't see in the docs) provide options to a component as I'm not using any component.

And the summary option has the exact same effect as description: it replaces the route's URI with the provided text in the left panel.

@AlexVarchuk
Copy link
Collaborator

@clement-estone For now, we don't have the opportunity to change it from yaml file.
What tool and how do you use for generating HTML? If you use our tools for generating HTML you can add these options after creating HTML.

@clement-estone
Copy link
Author

clement-estone commented Mar 14, 2022

I'm using the redoc bundle command to build the HTML file. I've already looked into the produced HTML file but I don't see any RedocStandalone component usage in it.

@AlexVarchuk
Copy link
Collaborator

@clement-estone Try to pass options. It works for me.

redoc-cli bundle path/to/definition.yaml --options.sideNavStyle=path-only

@clement-estone
Copy link
Author

It works fine, thank you very much!

It may be a good idea to show how to do this in the docs?

@AlexVarchuk
Copy link
Collaborator

@clement-estone I am glad to help you.
Yes, it is a good idea. We'll improve documentation.
If you had more questions please let us know.

@vpzomtrrfrt
Copy link

For those stumbling across this now, the argument for redocly build-docs appears to be --theme.openapi.sideNavStyle=path-only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants