Skip to main content

A MkDocs plugin supports for add Swagger UI in page.

Project description

MkDocs Swagger UI Tag

PyPI version PyPI downloads

A MkDocs plugin supports for add Swagger UI in page.

Live demo with mkdocs-material theme.

Features

  1. OpenAPI Specification file from online over URL or static file in docs
  2. Multiple Swagger UI in same page
  3. Synchronized dark mode with mkdocs-material

Dependency

  1. Python Package
    1. beautifulsoup4==4.11.1
  2. Swagger UI dist javascript file and css file
    1. swagger-ui-dist==4.12.0

Usage

  1. Install plugin from pypi

    pip install mkdocs-swagger-ui-tag
    
  2. Add swagger-ui-tag plugin in to your mkdocs.yml plugins sections:

    plugins:
       - swagger-ui-tag
    
  3. You may customize the plugin by passing options in mkdocs.yml:

    plugins:
       - swagger-ui-tag:
            background: White
    
    Option Default Description
    background "" Swagger UI iframe body background attribute value. You can use any css value for background for example "#74b9ff" or Gainsboro or "" for nothing.
  4. Add swagger-ui tag in markdown to include Swagger UI

    <swagger-ui src="https://petstore.swagger.io/v2/swagger.json"/>
    

    Swagger UI Sample Image

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Reference

  1. Amoenus Swagger Dark Theme: source of dark mode css

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-swagger-ui-tag-0.2.0.tar.gz (2.7 MB view hashes)

Uploaded Source

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