Skip to main content

MKDocs plugin for rendering swagger & openapi files.

Project description

mkdocs-render-swagger-plugin

This is the Mkdocs plugin for rendering swagger & openapi schemas using Swagger UI. It is written in Python.

Usage

Add the following lines to your mkdocs.yml:

plugins:
  - render_swagger

Enter !!swagger <filename>!! at the appropriate location inside a markdown file.

Explicit declaration of the Swagger JS library

You can explicitly specify the swagger-ui css and js dependencies if you wish to not use the unpkg CDN.

Keep in mind, the filename has to be swagger-ui.css for the CSS and swagger-ui-bundle.js for the JS.

To specify this use extra_javascript and extra_css in your mkdocs.yaml:

extra_javascript:
  - assets/js/swagger-ui-bundle.js

extra_css:
  - assets/css/swagger-ui.css

Contributing & Developing Locally

After downloading and extracting the .tar.gz, install this package locally using pip and the --editable flag:

pip install --editable .

You'll then have the render-swagger package available to use in Mkdocs and pip will point the dependency to this folder. You are then able to run the docs using mkdocs serve. Make sure you restart the process between code changes as the plugin is loaded on startup.

MkDocs plugins and Swagger api

The Render Swagger MkDocs plugin uses a set of extensions and plugin APIs that MkDocs and Swagger UI supports. You can find more info about MkDocks plugins and Swagger UI on the official website of MkDocks and SwaggerUI.

The input OpenAPI files processed by the plugin should conform to the OpenAPI specification. It is generated by a few projects such as pydantic, FastAPI and others.


Disclaimer: This plugin is unofficial, and is not sponsored, owned or endorsed by mkdocs, swagger, or any other 3rd party.
Credits to @aviramha for starting this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs-render-swagger-plugin-0.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file mkdocs-render-swagger-plugin-0.0.2.tar.gz.

File metadata

  • Download URL: mkdocs-render-swagger-plugin-0.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for mkdocs-render-swagger-plugin-0.0.2.tar.gz
Algorithm Hash digest
SHA256 70266c9d2bc7857b4ea044d13a616c2244c47df10a1cbaf9e6f5769d83ac5618
MD5 a77caab9cc46208b97497d4d2ffb7e99
BLAKE2b-256 50546fb55f9c3781669992ce2744d0e2b6e8c83ff44c69016c0201aac41efdc3

See more details on using hashes here.

File details

Details for the file mkdocs_render_swagger_plugin-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_render_swagger_plugin-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for mkdocs_render_swagger_plugin-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 349fe1ca0a80ca3ac017c160ae6746b2a4c4268a495bc903f73488f29dc9fe34
MD5 62b1fe96632807c0c4253afa83ce6e27
BLAKE2b-256 9ffc076ffe2ca3e4d360be526c99a0b48d1deeab19a43d412dd44de78383cfe0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page