Giter Site home page Giter Site logo

Comments (18)

serut avatar serut commented on July 28, 2024 1

Either a dropdown or a line bar with all microservice API next to each other

from redocusaurus.

DatStorm avatar DatStorm commented on July 28, 2024 1

Have there been any progress on this? Looking to document 8 different microservices each with their own endpoint.

from redocusaurus.

DatStorm avatar DatStorm commented on July 28, 2024 1

Really nice example I like that. The way I had it working right now was:

  1. Create a file with x-tagGroups and then (https://redoc.ly/docs/api-reference-docs/specification-extensions/x-tag-groups/)
  2. Merge all files with https://www.npmjs.com/package/openapi-merge

But I like your example solution more. Will do that instead

from redocusaurus.

serut avatar serut commented on July 28, 2024 1

Your solution does not fit on my layout. I have already too much content on the navbar...

image

Will try to develop something appropriate when I get some spare time. (with versionning, which matters for us)

from redocusaurus.

serut avatar serut commented on July 28, 2024 1

I've created a new React component that I use to display the documentation with double sidebars :
image
Ok, on small screens it would be hard to use. Maybe I can tweak the theme, when #129 is deployed, to make it more attractive, as the center does not have much space on 22" screens.
As I'm using mdx file to run redoc and not the specs parameter inside docusaurus.config.js file, my API is versionned 🎉 .

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024 1

This was done thanks to the ideas from the community! Pretty cool to see all the different usages in the wild.

Thanks to @serut for the initial request and work. And this MDX example with existing components by @TheCatLady here: https://github.com/someengineering/resoto.com/blob/7494b135d87533e54372e2f632f570dab3d06d6d/docs/reference/api.md

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

This seems like it would be difficult (or impossible to do). As the API docs are rendered as a single React component. We don't have the content of the sidebar to integrate with the Docusaurus sidebar.

You could create your own React component that wraps the @theme/Redoc component and add custom header navigation elements maybe? I think it will be difficult to merge complex sidebars

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

If you want to version your API then just have multiple YAML files, each for each version of your API

from redocusaurus.

serut avatar serut commented on July 28, 2024

I have no idea how React component are rendered by docusaurus.
Maybe the page itself should have everything related to redoc so it renders the sidebar then as the main content it renders the redoc in the center of the page. Currently from the docusaurus.config.js file it's pretty impossible to do it
Yes, for versonned API I think the "fake page" is good enough, but I didn't try it

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

Maybe the page itself should have everything related to redoc so it renders the sidebar then as the main content it renders the redoc in the center of the page. Currently from the docusaurus.config.js file it's pretty impossible to do it

I don't think that would look good, but I'll keep the issue open if anyone wants to give this a try or to see if there is demand for this.

from redocusaurus.

serut avatar serut commented on July 28, 2024

How would you display 10 microservices API, if you don't have a sidebar ?

If there is another way, I'm open to that. :)

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

How would you display 10 microservices API, if you don't have a sidebar ?

Sidebar is a good idea, but not a nested sidebar because redoc would have it's own sidebar. Maybe a dropdown would look better, below the header?

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

How about just adding a dropdown to the navbar (navbar-dropdowns) and grouping all the docs there?

See example I just added :

{
label: 'Examples',
position: 'left',
items: [
{
label: 'All',
to: '/examples',
},
{
label: 'Custom Page',
to: '/examples/custom-page/',
},
{
label: 'Custom Layout',
to: '/examples/custom-layout/',
},
{
label: 'Using Spec URL',
to: '/examples/using-spec-url/',
},
{
label: 'Using Spec YAML',
to: '/examples/using-spec-yaml/',
},
],
},

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

As I'm using mdx file to run redoc and not the specs parameter inside docusaurus.config.js file, my API is versionned 🎉 .

That is genius!! 🎉

Ok, on small screens it would be hard to use.

You can modify the breakpoints in the theme to keep the view always single pane? That sounds like a good compromise

from redocusaurus.

serut avatar serut commented on July 28, 2024

That is genius!! 🎉

Thanks !

You can modify the breakpoints in the theme to keep the view always single pane?

Which property are you talking about ?

I'm going to make two more PR : the component that I use to make it possible, as it can be stored on your theme package https://github.com/RegardsOss/RegardsOss.github.io/blob/master/src/redoc/RegardsApiDoc.jsx

And add https://github.com/RegardsOss/RegardsOss.github.io as user of your lib

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

You can modify the breakpoints in the theme to keep the view always single pane?

Which property are you talking about ?

https://github.com/Redocly/redoc#redoc-theme-object -> breakpoints

breakpoints # breakpoints for switching three/two and mobile view layouts

small: '50rem'
medium: '85rem'
large: '105rem'

We can force the 2 pane view with this I think (moves examples/code-samples below schema).

And add RegardsOss/RegardsOss.github.io as user of your lib

Would be great!

from redocusaurus.

serut avatar serut commented on July 28, 2024

We can force the 2 pane view with this I think (moves examples/code-samples below schema).

It works great ! Thanks

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

This is now possible to do with a new ApiDocMdx component in v1.1.0. See the guide here: https://redocusaurus.vercel.app/docs/guides/multiple-apis

And example here: https://redocusaurus.vercel.app/docs/nested/nested-1

from redocusaurus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.