A Python Markdown extension to include Swagger informations in your documentation
Project description
swagger-markdown
A Python Markdown extension to include Swagger definition and paths in your markdown documentation. This extension works with Swagger 2.0 JSON files.
To install:
pip install swagger-markdown
How to use with python-markdown
import markdown
import unittest
from swaggermarkdown import SwaggerExtension
md = markdown.Markdown(extensions=[SwaggerExtension()])
text = ':swg-def: tess/test_swagger.json FirstDefinition'
converted = md.convert(text)
Or more simply
import markdown
markdown.markdown('some markdown', extensions=['swaggermarkdown']))
Configuration
SwaggerExtension(
definitionsUrlRoot='/types', # add an url in front of definition links
file='tests/test_swagger.json' # redefine the default file (default: swagger.json)
)
How to use with MkDocs
markdown_extensions:
- swaggermarkdown
How to use in your markdown files
## My Pet Api
### Endpoint /pet/findByTags
:swg-path: /pet/findByTags
### Pet definition
:swg-def: Pet
You should get a table similar to this
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
swagger-markdown-0.9.1.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for swagger_markdown-0.9.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20e4cb6dfd8e716099e3d04ff7a55d2b20df254f9a8ad10f5deeb8aad2918ff8 |
|
MD5 | a21cf404c2cfe51bee719c05eb1fa4d1 |
|
BLAKE2b-256 | 91de9eac6ccda2ae1bf53730590e5faa384c07ace905dd9499537d6123a40a64 |