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

Install the plugin using pip install mkdocs-render-swagger-plugin.

Add the following lines to your mkdocs.yml:

plugins:
  - render_swagger

Place an OpenAPI json in the same folder as the the .md file.

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

Referencing external json

You may reference an external OpenAPI json using the following syntax: !!swagger-http <url>!!.

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.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

  • Download URL: mkdocs-render-swagger-plugin-0.0.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for mkdocs-render-swagger-plugin-0.0.3.tar.gz
Algorithm Hash digest
SHA256 30e9fe80ba2bdbc2f634e97f9c78b8e71199b1268af4ad192decbc8351b1fe96
MD5 da64dbfb180a416566272387681dce59
BLAKE2b-256 a7554ca08d1ef16c3bec7f5da7bb3a78e7fcaa1de55f50f1394272942e428bb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mkdocs_render_swagger_plugin-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for mkdocs_render_swagger_plugin-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b8002e34d9bfd3f8eb13d879201da465080ce6b44bb3933ba8a385990c2abe6c
MD5 3383cc85a288126460e49b30730bbf70
BLAKE2b-256 76a84679ab4b49ccd24cdea73b9124496556f5e6db88c498747edd7bf9479f2f

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