A MkDocs plugin supports for add Redoc in page.
Project description
MkDocs Redoc Tag
A MkDocs plugin supports adding Redoc to the page.
Features
- OpenAPI Specification file from online over URL or static file in docs
- All dependencies are using static files handled by the plugin not from CDN, especially suitable for those documents been deployed in the intranet
- Synchronized dark mode with Material for MkDocs
Dependency
- Python Package
- beautifulsoup4>=4.11.1
- Redoc standalone javascript from official CDN
- redoc==2.1.3
Usage
-
Install the plugin from Pypi
pip install mkdocs-redoc-tag
-
Add
redoc-tag
plugin into your mkdocs.yml plugins sections:plugins: - redoc-tag
-
Add
redoc
tag in markdown to include Redoc:<redoc src="https://petstore.swagger.io/v2/swagger.json"/>
-
You may customize the plugin by passing options in mkdocs.yml:
plugins: - redoc-tag: background: White
Options Type Description background String Default: "". Redoc iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing. height String Default: "80vh". Height of Redoc iframe.
How it works
- Copy Redoc script file into
site/assets/javascripts/
directory - Search all redoc tags, then convert them to an iframe tag and generate the iframe target html with the given OpenAPI Specification src path
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Reference
- redark: source of dark mode javascript and css
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
mkdocs-redoc-tag-0.1.0.tar.gz
(279.9 kB
view details)
Built Distribution
File details
Details for the file mkdocs-redoc-tag-0.1.0.tar.gz
.
File metadata
- Download URL: mkdocs-redoc-tag-0.1.0.tar.gz
- Upload date:
- Size: 279.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1770033112f76d7ce4f53798be7aa8854e4b3bd9b5237ab911bf423c73a4cf6c |
|
MD5 | ef483d9644892b3304f6c7b5a31d78f2 |
|
BLAKE2b-256 | 82249618a8cd5c4caa7b06ee5357415e79bd4abe77d85a056fb8672cf981562b |
File details
Details for the file mkdocs_redoc_tag-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: mkdocs_redoc_tag-0.1.0-py3-none-any.whl
- Upload date:
- Size: 281.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80c97ad905f6daf89683b30796349de038f7032dd4e1df9b4b9bd305bbf45e93 |
|
MD5 | 1f1e35d19a9aa39ab612a36c08020975 |
|
BLAKE2b-256 | aba0d9b690bc0a06e89d41239c294f87301fd24a1450b796fd6950ba0e773ccf |