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
- Install the plugin using pip:
pip install mkdocs-swagger-ui-html
-
Copy over
docs/api-index.md
todocs/api-index.md
under your project (assuming your mkdocs working path is{root}/docs
) -
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 intoapi-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs-swagger-ui-html-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3ff33e277d29e2c5c6f2c1d40ea1fb984f906ad5293f7469c2096f241730dc9 |
|
MD5 | 3625bcca3a80e68767989a5dea11771c |
|
BLAKE2b-256 | 4a525ed32facd98031720598489071676c7bc19c6f9ca41bbdb1f8f1f13c8ea2 |
Hashes for mkdocs_swagger_ui_html-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 845244a3573717728ed6c400e92511b180bdf7f4f9a219e9058aaa7c730a9e36 |
|
MD5 | 49711921c3182fc4a39a63d7dc6796f8 |
|
BLAKE2b-256 | fd91260dc422f9d048225a6fe55ee1d46195a2220e21535ed1ff48175f5326ed |