Giter Site home page Giter Site logo

blueswen / mkdocs-redoc-tag Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 676 KB

A MkDocs plugin supports adding Redoc to the page.

Home Page: https://blueswen.github.io/mkdocs-redoc-tag/

License: MIT License

Shell 1.31% Python 75.66% JavaScript 18.11% HTML 4.18% CSS 0.75%
mkdocs mkdocs-plugin openapi openapi3 redoc

mkdocs-redoc-tag's Introduction

Hello there ๐Ÿ‘‹

Hi, I am @Blueswen (Yi-Wei, Liu), a Software Engineer focus on Web Application, DevOps, Cloud Native and Developer Experience.

Want to be a full stack developer, but just a stack overflow developer right now.

My Tech Stack

Vue.js Python Docker K8s

Blueswen's GitHub stats

mkdocs-redoc-tag's People

Contributors

blueswen avatar

Stargazers

 avatar

Watchers

 avatar

mkdocs-redoc-tag's Issues

How to increase the content width ?

Hi,
thank you so much for making this plugin! ๐Ÿ‘ I've tried it and everything seems to work as expected when using with mkdocs serve.

I just didn't figure out how to extend the content to use the whole space of the page.

Even if I include:

---
hide:
  - navigation
  - toc
---

in the markdown file header, the ReDoc OpenAPI content still doesn't use the whole available space on the page. Maybe on a small screen is is not an issue, but on 4k, it looks weird.
Have a look at the screenshot below.
image

Including an extra CSS stylesheet (as proposed e.g. here doesn't solve the problem, because is makes wider everything, not just this page.

Also, an option to remove the extra scroll bar and really integrate the specs as page content would be very cool.

Compatibility with offline plugin

Hi,
I just tried to generate a fully static offline documentation website that would be working properly without any webserver. Unfortunately it seems that there is a similar bug to the one described in the issue I've opened for mkdocs-swagger-ui-tag plugin.

When using offline, I see just blank page and in the developer console in web browser, there is an error:

redoc-6bece43f.html:24 Uncaught DOMException: Failed to read a named property 'scheme' from 'Window': Blocked a frame with origin "null" from accessing a cross-origin frame.
    at window.onload (file:///<local path>/redoc-6bece43f.html:24:36)

which points to following section of generated .html file:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Redoc</title>
  <link rel="stylesheet" type="text/css" id="slate-css" media="none" href="assets/stylesheets/redark.css" />
  <script src="assets/javascripts/redark.js" charset="UTF-8"> </script>
  <style>
    body {
      margin: 0;
      padding: 0;
    }
  </style>
</head>

<body style="background: ;">
  <div id="redoc-container"></div>
  <script src="assets/javascripts/redoc.standalone.js" charset="UTF-8"> </script>
  <script>
    const openapi_spec_url = "assets/openapi/openapi.json";

    window.onload = function () {
      const parent_scheme = parent.scheme               <---------------- HERE the exception occurrs
      if (parent_scheme === "slate") {
        enable_dark_mode();
      } else {
        disable_dark_mode();
      }
    }

    enable_dark_mode = function(){
      document.getElementById("slate-css").media = ""
      Redoc.init(
        openapi_spec_url,
        { theme: redark },
        document.getElementById('redoc-container'),
      );
    }

    disable_dark_mode = function(){
      document.getElementById("slate-css").media = "none"
      Redoc.init(
        openapi_spec_url,
        {},
        document.getElementById('redoc-container'),
      );
    }
  </script>
</body>

</html>

I appreciate any help. I really like your plugin and this issue is the only thing stopping us to use it on our project.

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.