Using Material for MkDocs and PyMdownX for some REST API Doc design #3909
Replies: 8 comments 12 replies
-
Very cool! I've seen some attempts to generate documentation from OpenAPI specs – really awesome to see some innovation in that space, and this already looks pretty good. |
Beta Was this translation helpful? Give feedback.
-
I used this for a test and it looks nice. It connects online so it renders (almost) identical as on the swagger.io (some colors are not the same). |
Beta Was this translation helpful? Give feedback.
-
It looks like the same as on the web. Actually it connects to the swagger.io or you need to download the swagger-ui.js file (like I do). The only difference is that the combination of colors make it unreadable in some cases (e.g. examples with light option or some texts with dark option). While the same at swagger.io looks much better because background is black. I guess, but could be totally wrong, that some of the settings of the material mkdocs overwrite the color of this background. But no idea at all. |
Beta Was this translation helpful? Give feedback.
-
Great. It solves my problem of lack of contrast in the examples that I had with the previous plugin. Many thanks. |
Beta Was this translation helpful? Give feedback.
-
The latest admonition changes look really nice for my API Docs (Again, no swagger, only manual design) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
how such a plugin can work if we use a github action to publish the website to a github pages? |
Beta Was this translation helpful? Give feedback.
-
Just for the sake of being up-to-date and giving proper info is here my current setup: I use a hook (Single python file MkDocs can load to execute stuff almost like a plugin) to look for a specific text in a page and when found use Essentials OpenAPI to create a new Jinja2 parser with modified templates to generate the output. It's effectively the mkdocsoad plugin, but modified to fit my own design need (And to reduce depenencies). The hook: https://github.com/purrbot-site/Docs/blob/master/theme/.hooks/api_docs_gen.py |
Beta Was this translation helpful? Give feedback.
-
The goal was to make API documentation that MIMICS OpenAPI in terms of design. With that said is the shown content NOT the result of using OpenAPI. This is all hand made using the
details
andsnippets
expansion from PyMdownX.General look:
POST content:
Success Response:
Failed Responses:
GET content:
Success Response:
Failed Responses:
Beta Was this translation helpful? Give feedback.
All reactions