Skip to main content

MKDocs plugin for rendering swagger & openapi files.

Project description


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


Add the following lines to your mkdocs.yml:

  - 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:

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

  - 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.

<small> 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. </small>

Project details

Download files

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

Files for mkdocs-render-swagger-plugin, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size mkdocs_render_swagger_plugin-0.0.2-py3-none-any.whl (4.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mkdocs-render-swagger-plugin-0.0.2.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page