Giter Site home page Giter Site logo

Comments (6)

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

This will be upcoming in the v1 release. It uses the official redoc openapi-cli under the hood, to maximise compatibility. Also, the bundled yaml will automatically be added as a static asset and used as download url 😄

from redocusaurus.

factoidforrest avatar factoidforrest commented on July 28, 2024 2

A good bundler is the npm openapi tool itself @openapitools/openapi-generator-cli, which you can invoke from a package.json command like
"schema:copy": "openapi-generator-cli generate -i ../api-spec/schema/yourschema.yaml -g openapi-yaml -o ./static"

Very poorly documented feature, that generator is listed under "documentation generators" 🙄 It cant also output json if you use openapi instead of openapi-yaml and it can take json as well.

Still, its a workaround.

from redocusaurus.

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

Added in the latest beta! It'll be great if you can test it out and give some feedback : #146

Example added here: https://github.com/rohit-gohri/redocusaurus/blob/releases/v1/website/docusaurus.config.js#L19-L24
YAMLs here: https://github.com/rohit-gohri/redocusaurus/tree/releases/v1/website/openapi/multi-yaml

from redocusaurus.

EdgarRuizUribe avatar EdgarRuizUribe commented on July 28, 2024 1

Hello! First of all I would like to thank you for the great contributions you make to the project. I'm recently using Docusaurus, and your documentation helped me a lot.
But I have some doubts, which I hope you can help me solve.

  1. Is there a way to remove the button so that they can download the services file that I refer to from my website?
    image

  2. Is there a way to group all my remote .yaml files in a side menu, like the one for documents?
    That is to say, that in the upper tabs, there is only one item and when clicking on it, the side menu opens with the different
    documentations. (as the documents section does)

image

Again, thank you very much for your great contributions on this topic, greetings.

from redocusaurus.

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

I agree that breaking up specs into multiple files makes for a much better workflow. I think this is possible when generating docs with the redoc cli but not with redocusaurus currently. Even I was using https://github.com/Redocly/openapi-cli to bundle my files into a single yaml.

I think this is a valid use case and would like to add it to the project, but I can't be certain when I would get time.

If you want to give it a try, feel free to do so and open a PR.
We would have to add https://github.com/Redocly/openapi-cli/tree/master/packages/core#bundle here:

if (spec.endsWith('.yaml') || spec.endsWith('.yml')) {
const parsedSpec = YAML.parse(file);
content = parsedSpec;
}

from redocusaurus.

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

Hey @EdgarRuizUribe! Happy to help, but best to create a new issue or discussion in the future for questions.

Is there a way to remove the button so that they can download the services file that I refer to from my website?

redoc has an option to hideDownloadButton that you can pass to it by setting it in config:

module.exports = {
  // ...
  presets: [
    [
      'redocusaurus',
      {
        // Plugin Options for loading OpenAPI files
        specs: [
          {
            spec: 'openapi/openapi.yaml',
            route: '/api/',
          },
        ],
        // Theme Options for modifying how redoc renders them
        theme: {
          primaryColor: '#1890ff',
          options: {
            // this is what needs to be set:
            hideDownloadButton: true,
          },
        },
      },
    ],
  ],
  // ...
};

Is there a way to group all my remote .yaml files in a side menu, like the one for documents?

That is currently not supported, there is some discussion with different approaches in this issue : #108 . One way is to use MDX files to render nested sidebars. Best to use that issue for further discussions related to this.

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.