Skip to main content

An MkDocs plugin to generate a markdown file containing an API reference built using Swagger UI from a base OAS3 specification.

Project description

mkdocs-swagger-ui-html

A MkDocs plugin created to help developer embed API Reference documentation into a mkdocs powered website. API specs data will be rendered with Swagger Editor-like style.

Setup

  1. Install the plugin using pip:

pip install mkdocs-swagger-ui-html

  1. Copy over docs/api-index.md to docs/api-index.md under your project (assuming your mkdocs working path is {root}/docs)

  2. Activate the plugin in mkdocs.yml:

plugins:
  - swagger-ui:
      spec_url: 'https://netstorage.ringcentral.com/dpw/api-reference/specs/rc-platform.yml'

Options

  • spec_url: Sets the URL to the Swagger specification for the RingCentral platform. This should default to the official URL. Override this for development purposes only.

More information about plugins in the MkDocs documentation.

How the plugin works

  • Input: API specs YAML file

  • Render: The plugin takes API specs data and generates api-index.html

  • Injection: api-index.html file will be injected into api-index.md file and rendered along with other md files under the same mkdocs theme when the server is running

plugins:
  - swagger-ui:
      outfile: api/quick-reference.md
pages:
  - 'Home': index.md
  - 'API Reference': api-index.md

Additional Note

  • Warning: mkdocs has hot loading mechanism and this plugin writes files to your local storage, so change and save files when the server is running will cause infinite hot loading issue. Please stop and restart the server before you apply any changes.

TODO

  • Add JSON API specs support

See Also

More information about templates here.

More information about blocks here.

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-html-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

mkdocs_swagger_ui_html-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs-swagger-ui-html-0.1.1.tar.gz.

File metadata

  • Download URL: mkdocs-swagger-ui-html-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for mkdocs-swagger-ui-html-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e3ff33e277d29e2c5c6f2c1d40ea1fb984f906ad5293f7469c2096f241730dc9
MD5 3625bcca3a80e68767989a5dea11771c
BLAKE2b-256 4a525ed32facd98031720598489071676c7bc19c6f9ca41bbdb1f8f1f13c8ea2

See more details on using hashes here.

File details

Details for the file mkdocs_swagger_ui_html-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_swagger_ui_html-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for mkdocs_swagger_ui_html-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 845244a3573717728ed6c400e92511b180bdf7f4f9a219e9058aaa7c730a9e36
MD5 49711921c3182fc4a39a63d7dc6796f8
BLAKE2b-256 fd91260dc422f9d048225a6fe55ee1d46195a2220e21535ed1ff48175f5326ed

See more details on using hashes here.

Supported by

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