HiDeoo / starlight-openapi

Starlight plugin to generate documentation from OpenAPI/Swagger specifications
https://starlight-openapi.vercel.app
MIT License
107 stars 13 forks source link

Display sidebar when viewing OpenApi docs #11

Closed Fruetel closed 7 months ago

Fruetel commented 11 months ago

Is your feature request related to a problem?

When visiting a page generated by starlight-openapi (e.g. https://starlight-openapi.vercel.app/api/petstore/operations/addpet/) , the sidebar disappears. My only option to view another page is to navigate with the back button first. This behavior does not blend in well with the rest of the Starlight page, where the sidebar is typically present all the time.

Describe the solution you'd like

Ideal solution would be to specify sidebar behavior for starlight-openapi in astro.config.mjs. However, the sidebar always being there would be a reasonable default IMO.

Describe alternatives you've considered

No response

Additional Context

No response

stefanofa commented 11 months ago

I believe that @HiDeoo is already working to solve this problem. Meanwhile, if you want to have the sidebar at all costs, you should use the 0.2.2 release of starlight-openapi and a <0.11.0 version of starlight.

Fruetel commented 11 months ago

Thanks for pointing this out, @stefanofa. Guess the issue is obsolete then.

HiDeoo commented 11 months ago

Thanks for jumping in @stefanofa, really appreciate it. :raised_hands:

This is indeed a regression in the latest version as mentioned in the release notes due to some changes in Starlight 0.11.0.

I already opened an issue in the Starlight repository to discuss/think how this could be handled but the goal is definitely to bring back the sidebar as it was before.

I'll make sure to ping this issue when a fix is available.

edelbalso commented 11 months ago

Would be really helpful for anybody looking this up in the future to see the issue as open until it is resolved. I had not realized it was a known issue until I thought to look at closed issues, and I would like to follow this issue so I'm notified when it is fixed.

HiDeoo commented 11 months ago

Would be really helpful for anybody looking this up in the future to see the issue as open until it is resolved.

Good point, this was closed by the author and I forgot to reopen it. This is now reopened.

stefanofa commented 10 months ago

Hey @HiDeoo, absolutely not to stress you out, but do you have any idea when this feature might be released?

HiDeoo commented 10 months ago

Hey @HiDeoo, absolutely not to stress you out, but do you have any idea when this feature might be released?

This requires changes into Starlight that I have described in this discussion and I recently posted my ideas for a fix in this post but so far I didn't get any feedack or suggestions yet.

If I don't get any before I get enough time, I'll switch to making a PR with the changes I described.

huijing commented 9 months ago

Hello, I've been following along with the related issues and discussions (this turned out to be more complicated than I thought, and saw the latest PR update in https://github.com/withastro/starlight/pull/1175#issuecomment-1871868017. And I was wondering if that goes in, this issue can be resolved as well?

HiDeoo commented 9 months ago

And I was wondering if that goes in, this issue can be resolved as well?

Yes, definitely. The PR has a pretty broad scope and try to fix various issues related to custom pages and one of them is indeed having custom content in a custom page using the Starlight layout with the default sidebar.

This page from the PR preview is an example of a dynamically injected page with some custom content that could be the content of the starlight-openapi integration (which will be refactored to a Starlight plugin if the PR is merged) while still having the default Starlight sidebar.

huijing commented 9 months ago

Oh wow, the possibilities have been greatly expanded. This is amazing work. 🙇🏻‍♀️🙇🏻‍♀️🙇🏻‍♀️

huijing commented 7 months ago

Hello 👋, I see that https://github.com/withastro/starlight/pull/1175 has finally been merged 🥳 . Will there be an update to this plugin, or is there anything those of us using it ought to do to make the sidebar work again?

HiDeoo commented 7 months ago

Thanks everyone for your patience with this issue.

v0.5.0 fixes the issue, e.g. this demo page which now includes the Starlight sidebar.

stefanofa commented 7 months ago

hey @HiDeoo , from behind the scenes I have been following the immense work you have done to make everything possible over the releases of the past few days, and I simply wanted to thank you ❤️