Skip to main content

Plugins for MkDocs

Project description

Build pypi versions license codecov

Plugins for MkDocs

pip install neoteroi-mkdocs

MkDocsOAD

Plugin for MkDocs to generate human readable documentation from OpenAPI Documentation Version 3 (also known as Swagger documentation).

How to use:

  1. Install using pip install neoteroi-mkdocs
  2. Configure this plugin in the MkDocs configuration file:
plugins:
  - neoteroi.mkdocsoad
  1. Configure a source in your Markdown file, for example having a swagger.json file in your docs folder:
[OAD(./docs/swagger.json)]

The plugin fetches the contents from the OpenAPI Specification source, generates Markdown using essentials-openapi, then writes them in the markdown file.

Example result:

Example result

Recommended: enable PyMDown and extra CSS

This plugin has been originally designed to generate Markdown that makes use of three extensions from PyMdown extensions. To achieve the best results, it is recommended to enable PyMdown extensions.

  1. Install PyMdown extensions using pip install pymdown-extensions
  2. Configure the following PyMdown markdown extensions in the MkDocs configuration file:
markdown_extensions:
  - pymdownx.details
  - pymdownx.superfences
  - pymdownx.tabbed:
      alternate_style: true

Enable PyMdown integration this way:

plugins:
  - neoteroi.mkdocsoad:
      use_pymdownx: true

Download a local copy of the provided extra.css file and configure it as extra file in your MkDocs configuration:

extra_css:
  - css/extra.css

Supported sources for OpenAPI Documentation

Source Example
YAML file [OAD(./docs/swagger.yaml)]
JSON file [OAD(./docs/swagger.json)]
URL returning YAML on HTTP GET [OAD(https://example-domain.net/swagger/v1/swagger.yaml)]
URL returning JSON on HTTP GET [OAD(https://example-domain.net/swagger/v1/swagger.json)]

Example result

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

neoteroi-mkdocs-0.0.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

neoteroi_mkdocs-0.0.1-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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