MkDocs Swagger UI Tag

0.8.0 · active · verified Thu Apr 16

mkdocs-swagger-ui-tag is an active MkDocs plugin that allows developers to embed interactive Swagger UI (OpenAPI) documentation directly into their MkDocs-generated pages. It supports both online OpenAPI Specification files via URL and static files stored within the `docs` directory, offering features like multiple Swagger UIs on a single page, and synchronized dark mode with themes like Material for MkDocs. The plugin handles all its JavaScript and CSS dependencies locally, making it suitable for environments without direct CDN access. It is currently at version 0.8.0.

Common errors

Warnings

Install

Quickstart

To quickly integrate `mkdocs-swagger-ui-tag`, first, create an `mkdocs.yml` file and enable the plugin under the `plugins` section. Then, within any Markdown file (e.g., `api.md`), use the `<swagger-ui>` custom tag, providing the `src` attribute with the path to your OpenAPI specification file (e.g., `openapi.yaml`) which should be located within your `docs` directory. Finally, run `mkdocs serve` to see your documentation with the embedded Swagger UI.

site_name: My API Docs
theme: material

plugins:
  - swagger-ui-tag

nav:
  - Home: index.md
  - API Reference: api.md

# api.md content example:
# # My API Documentation
#
# <swagger-ui src="./openapi.yaml" />

view raw JSON →