mkdocs-owl-api 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mkdocs_owl_api-0.1.0/.github/workflows/ci.yml +38 -0
- mkdocs_owl_api-0.1.0/.github/workflows/publish.yml +40 -0
- mkdocs_owl_api-0.1.0/.gitignore +227 -0
- mkdocs_owl_api-0.1.0/LICENSE +21 -0
- mkdocs_owl_api-0.1.0/PKG-INFO +157 -0
- mkdocs_owl_api-0.1.0/README.md +128 -0
- mkdocs_owl_api-0.1.0/example/README.md +15 -0
- mkdocs_owl_api-0.1.0/example/docs/api/petstore.md +4 -0
- mkdocs_owl_api-0.1.0/example/docs/api/streetlight-reference.md +4 -0
- mkdocs_owl_api-0.1.0/example/docs/assets/streetlight-api.yml +206 -0
- mkdocs_owl_api-0.1.0/example/docs/index.md +3 -0
- mkdocs_owl_api-0.1.0/example/mkdocs.yml +33 -0
- mkdocs_owl_api-0.1.0/pyproject.toml +59 -0
- mkdocs_owl_api-0.1.0/src/mkdocs_owl_api/__init__.py +1 -0
- mkdocs_owl_api-0.1.0/src/mkdocs_owl_api/loader.py +223 -0
- mkdocs_owl_api-0.1.0/src/mkdocs_owl_api/plugin.py +94 -0
- mkdocs_owl_api-0.1.0/src/mkdocs_owl_api/render/__init__.py +0 -0
- mkdocs_owl_api-0.1.0/src/mkdocs_owl_api/render/asyncapi.py +570 -0
- mkdocs_owl_api-0.1.0/src/mkdocs_owl_api/render/common.py +612 -0
- mkdocs_owl_api-0.1.0/src/mkdocs_owl_api/render/openapi.py +293 -0
- mkdocs_owl_api-0.1.0/src/mkdocs_owl_api/static/techdocs-owl-api.css +109 -0
- mkdocs_owl_api-0.1.0/tests/__init__.py +0 -0
- mkdocs_owl_api-0.1.0/tests/test_asyncapi.py +111 -0
- mkdocs_owl_api-0.1.0/tests/test_common.py +180 -0
- mkdocs_owl_api-0.1.0/tests/test_loader.py +129 -0
- mkdocs_owl_api-0.1.0/tests/test_openapi.py +87 -0
- mkdocs_owl_api-0.1.0/tests/test_plugin.py +166 -0
- mkdocs_owl_api-0.1.0/uv.lock +939 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v6
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
enable-cache: true
|
|
22
|
+
- name: Sync dependencies
|
|
23
|
+
run: uv sync
|
|
24
|
+
- name: Run tests
|
|
25
|
+
run: uv run pytest
|
|
26
|
+
|
|
27
|
+
example-build:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@v6
|
|
33
|
+
with:
|
|
34
|
+
enable-cache: true
|
|
35
|
+
- name: Sync dependencies
|
|
36
|
+
run: uv sync
|
|
37
|
+
- name: Build example site
|
|
38
|
+
run: uv run mkdocs build -f example/mkdocs.yml
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- name: Install uv
|
|
13
|
+
uses: astral-sh/setup-uv@v6
|
|
14
|
+
with:
|
|
15
|
+
enable-cache: true
|
|
16
|
+
- name: Build distributions
|
|
17
|
+
run: uv build
|
|
18
|
+
- name: Validate metadata
|
|
19
|
+
run: uvx twine check dist/*
|
|
20
|
+
- uses: actions/upload-artifact@v4
|
|
21
|
+
with:
|
|
22
|
+
name: dist
|
|
23
|
+
path: dist/
|
|
24
|
+
|
|
25
|
+
publish:
|
|
26
|
+
needs: build
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
environment:
|
|
29
|
+
name: pypi
|
|
30
|
+
url: https://pypi.org/project/mkdocs-owl-api/
|
|
31
|
+
permissions:
|
|
32
|
+
# OIDC token for Trusted Publishing; no API token in repo secrets.
|
|
33
|
+
id-token: write
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/download-artifact@v4
|
|
36
|
+
with:
|
|
37
|
+
name: dist
|
|
38
|
+
path: dist/
|
|
39
|
+
- name: Publish to PyPI
|
|
40
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
# poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
example/site/
|
|
170
|
+
|
|
171
|
+
# generated by mkdocs-owl-api at build time (resolved specs + attachments)
|
|
172
|
+
example/docs/assets/techdocs-owl-api/
|
|
173
|
+
|
|
174
|
+
# mypy
|
|
175
|
+
.mypy_cache/
|
|
176
|
+
.dmypy.json
|
|
177
|
+
dmypy.json
|
|
178
|
+
|
|
179
|
+
# Pyre type checker
|
|
180
|
+
.pyre/
|
|
181
|
+
|
|
182
|
+
# pytype static type analyzer
|
|
183
|
+
.pytype/
|
|
184
|
+
|
|
185
|
+
# Cython debug symbols
|
|
186
|
+
cython_debug/
|
|
187
|
+
|
|
188
|
+
# PyCharm
|
|
189
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
190
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
191
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
192
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
193
|
+
# .idea/
|
|
194
|
+
|
|
195
|
+
# Abstra
|
|
196
|
+
# Abstra is an AI-powered process automation framework.
|
|
197
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
198
|
+
# Learn more at https://abstra.io/docs
|
|
199
|
+
.abstra/
|
|
200
|
+
|
|
201
|
+
# Visual Studio Code
|
|
202
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
203
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
204
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
205
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
206
|
+
# .vscode/
|
|
207
|
+
# Temporary file for partial code execution
|
|
208
|
+
tempCodeRunnerFile.py
|
|
209
|
+
|
|
210
|
+
# Ruff stuff:
|
|
211
|
+
.ruff_cache/
|
|
212
|
+
|
|
213
|
+
# PyPI configuration file
|
|
214
|
+
.pypirc
|
|
215
|
+
|
|
216
|
+
# Marimo
|
|
217
|
+
marimo/_static/
|
|
218
|
+
marimo/_lsp/
|
|
219
|
+
__marimo__/
|
|
220
|
+
|
|
221
|
+
# Streamlit
|
|
222
|
+
.streamlit/secrets.toml
|
|
223
|
+
|
|
224
|
+
# Local scratch notes/tasks (not part of the published project)
|
|
225
|
+
.tasks/
|
|
226
|
+
.claude/
|
|
227
|
+
CLAUDE.md
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 TechDocs Owl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mkdocs-owl-api
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MkDocs plugin from TechDocs Owl, renders AsyncAPI and OpenAPI specs into reference pages
|
|
5
|
+
Project-URL: Homepage, https://github.com/techdocs-owl/mkdocs-owl-api
|
|
6
|
+
Project-URL: Repository, https://github.com/techdocs-owl/mkdocs-owl-api
|
|
7
|
+
Project-URL: Issues, https://github.com/techdocs-owl/mkdocs-owl-api/issues
|
|
8
|
+
Author-email: Dima Patserkovskyi <dmtwngtech@pm.me>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: api-reference,asyncapi,documentation,mkdocs,mkdocs-plugin,openapi
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Framework :: MkDocs
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Documentation
|
|
23
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Requires-Dist: markdown>=3.4
|
|
26
|
+
Requires-Dist: mkdocs>=1.5
|
|
27
|
+
Requires-Dist: pyyaml>=6.0
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# techdocs-owl-api
|
|
31
|
+
|
|
32
|
+
MkDocs plugin that renders AsyncAPI and OpenAPI specs into reference pages
|
|
33
|
+
at build time.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install mkdocs-owl-api
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
# mkdocs.yml
|
|
43
|
+
plugins:
|
|
44
|
+
- search
|
|
45
|
+
- owl-api
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Add a page with a `techdocs-owl-asyncapi:` or `techdocs-owl-openapi:`
|
|
49
|
+
frontmatter key and an empty body — the plugin fills it in at build time.
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
---
|
|
53
|
+
techdocs-owl-asyncapi: ../specs/asyncapi.yml
|
|
54
|
+
---
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Supports AsyncAPI 2.x/3.0 and OpenAPI 3.x (YAML or JSON), local paths or
|
|
58
|
+
HTTP(S) URLs, recursive `$ref` resolution, and a bundled stylesheet
|
|
59
|
+
(auto-injected, no `extra_css` setup needed).
|
|
60
|
+
|
|
61
|
+
## Site-wide defaults
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
plugins:
|
|
65
|
+
- owl-api:
|
|
66
|
+
schema_depth: 3
|
|
67
|
+
hide_internal: false
|
|
68
|
+
hide_bindings: false
|
|
69
|
+
hide_traits: false
|
|
70
|
+
hide_security: false
|
|
71
|
+
hide_version: false
|
|
72
|
+
hide_download_link: false
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Page frontmatter overrides these per-page.
|
|
76
|
+
|
|
77
|
+
## AsyncAPI pages
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
---
|
|
81
|
+
techdocs-owl-asyncapi:
|
|
82
|
+
spec: https://schema.example.com/my-service-asyncapi
|
|
83
|
+
title: My Service Events
|
|
84
|
+
intro: One-paragraph intro shown above the spec body.
|
|
85
|
+
schema_depth: 3
|
|
86
|
+
---
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
| Key | Type | Default | Effect |
|
|
90
|
+
|---|---|---|---|
|
|
91
|
+
| `spec` | string | — | **Required.** Path or URL to the spec file. |
|
|
92
|
+
| `title` | string | `info.title` | Page H1. |
|
|
93
|
+
| `intro` | markdown | — | Shown between the title and metadata block. |
|
|
94
|
+
| `hide_version` | bool | `false` | Hide the version line. |
|
|
95
|
+
| `hide_internal` | bool | `false` | Drop properties marked `x-internal-only: true`. |
|
|
96
|
+
| `hide_bindings` | bool | `false` | Skip bindings on servers/channels/operations/messages. |
|
|
97
|
+
| `hide_traits` | bool | `false` | Skip trait sections and references. |
|
|
98
|
+
| `hide_security` | bool | `false` | Skip security admonitions. |
|
|
99
|
+
| `hide_download_link` | bool | `false` | Hide the spec download link. |
|
|
100
|
+
| `schema_depth` | int | `3` | Depth of dot-path flattening for nested object properties. |
|
|
101
|
+
| `attachments` | list | — | Extra files to copy and list in the downloads table. |
|
|
102
|
+
|
|
103
|
+
Renders, in order: info, Servers, Operations (operation-centric across
|
|
104
|
+
both AsyncAPI versions), Messages, Schemas, Parameters, Traits — sections
|
|
105
|
+
absent from the spec are skipped.
|
|
106
|
+
|
|
107
|
+
## OpenAPI pages
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
---
|
|
111
|
+
techdocs-owl-openapi: https://petstore3.swagger.io/api/v3/openapi.json
|
|
112
|
+
---
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
| Key | Type | Default | Effect |
|
|
116
|
+
|---|---|---|---|
|
|
117
|
+
| `spec` | string | — | **Required.** Path or URL to the spec file. |
|
|
118
|
+
| `title` | string | `info.title` | Page H1. |
|
|
119
|
+
| `intro` | markdown | — | Shown between the title and metadata block. |
|
|
120
|
+
| `hide_version` | bool | `false` | Hide the version line. |
|
|
121
|
+
| `hide_internal` | bool | `false` | Drop `x-internal-only` properties. |
|
|
122
|
+
| `hide_download_link` | bool | `false` | Hide the spec download link. |
|
|
123
|
+
| `schema_depth` | int | `3` | Depth of dot-path flattening for nested object properties. |
|
|
124
|
+
| `attachments` | list | — | Extra files to copy and list in the downloads table. |
|
|
125
|
+
|
|
126
|
+
Renders: info, Servers, endpoints grouped by tag (parameters, request
|
|
127
|
+
body, responses, security), Schemas.
|
|
128
|
+
|
|
129
|
+
## Downloads & attachments
|
|
130
|
+
|
|
131
|
+
The resolved spec (external `$ref`s inlined) is written to
|
|
132
|
+
`assets/techdocs-owl-api/<page-slug>.json` and linked from a Downloads
|
|
133
|
+
table. Add extra files (e.g. `.proto` schemas) with `attachments`:
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
---
|
|
137
|
+
techdocs-owl-asyncapi:
|
|
138
|
+
spec: ../specs/asyncapi.yml
|
|
139
|
+
attachments:
|
|
140
|
+
- path: ../schemas/customer.proto
|
|
141
|
+
title: Customer Protobuf Schema
|
|
142
|
+
- ../schemas/order.proto # shorthand: path only, title = filename
|
|
143
|
+
---
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Error handling
|
|
147
|
+
|
|
148
|
+
Errors (missing/unreadable spec, network failures, parse errors, bad
|
|
149
|
+
frontmatter) render as a `!!! danger` admonition instead of failing the
|
|
150
|
+
build.
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
uv sync
|
|
156
|
+
uv run pytest
|
|
157
|
+
```
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# techdocs-owl-api
|
|
2
|
+
|
|
3
|
+
MkDocs plugin that renders AsyncAPI and OpenAPI specs into reference pages
|
|
4
|
+
at build time.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install mkdocs-owl-api
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
# mkdocs.yml
|
|
14
|
+
plugins:
|
|
15
|
+
- search
|
|
16
|
+
- owl-api
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Add a page with a `techdocs-owl-asyncapi:` or `techdocs-owl-openapi:`
|
|
20
|
+
frontmatter key and an empty body — the plugin fills it in at build time.
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
---
|
|
24
|
+
techdocs-owl-asyncapi: ../specs/asyncapi.yml
|
|
25
|
+
---
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Supports AsyncAPI 2.x/3.0 and OpenAPI 3.x (YAML or JSON), local paths or
|
|
29
|
+
HTTP(S) URLs, recursive `$ref` resolution, and a bundled stylesheet
|
|
30
|
+
(auto-injected, no `extra_css` setup needed).
|
|
31
|
+
|
|
32
|
+
## Site-wide defaults
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
plugins:
|
|
36
|
+
- owl-api:
|
|
37
|
+
schema_depth: 3
|
|
38
|
+
hide_internal: false
|
|
39
|
+
hide_bindings: false
|
|
40
|
+
hide_traits: false
|
|
41
|
+
hide_security: false
|
|
42
|
+
hide_version: false
|
|
43
|
+
hide_download_link: false
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Page frontmatter overrides these per-page.
|
|
47
|
+
|
|
48
|
+
## AsyncAPI pages
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
---
|
|
52
|
+
techdocs-owl-asyncapi:
|
|
53
|
+
spec: https://schema.example.com/my-service-asyncapi
|
|
54
|
+
title: My Service Events
|
|
55
|
+
intro: One-paragraph intro shown above the spec body.
|
|
56
|
+
schema_depth: 3
|
|
57
|
+
---
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
| Key | Type | Default | Effect |
|
|
61
|
+
|---|---|---|---|
|
|
62
|
+
| `spec` | string | — | **Required.** Path or URL to the spec file. |
|
|
63
|
+
| `title` | string | `info.title` | Page H1. |
|
|
64
|
+
| `intro` | markdown | — | Shown between the title and metadata block. |
|
|
65
|
+
| `hide_version` | bool | `false` | Hide the version line. |
|
|
66
|
+
| `hide_internal` | bool | `false` | Drop properties marked `x-internal-only: true`. |
|
|
67
|
+
| `hide_bindings` | bool | `false` | Skip bindings on servers/channels/operations/messages. |
|
|
68
|
+
| `hide_traits` | bool | `false` | Skip trait sections and references. |
|
|
69
|
+
| `hide_security` | bool | `false` | Skip security admonitions. |
|
|
70
|
+
| `hide_download_link` | bool | `false` | Hide the spec download link. |
|
|
71
|
+
| `schema_depth` | int | `3` | Depth of dot-path flattening for nested object properties. |
|
|
72
|
+
| `attachments` | list | — | Extra files to copy and list in the downloads table. |
|
|
73
|
+
|
|
74
|
+
Renders, in order: info, Servers, Operations (operation-centric across
|
|
75
|
+
both AsyncAPI versions), Messages, Schemas, Parameters, Traits — sections
|
|
76
|
+
absent from the spec are skipped.
|
|
77
|
+
|
|
78
|
+
## OpenAPI pages
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
---
|
|
82
|
+
techdocs-owl-openapi: https://petstore3.swagger.io/api/v3/openapi.json
|
|
83
|
+
---
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
| Key | Type | Default | Effect |
|
|
87
|
+
|---|---|---|---|
|
|
88
|
+
| `spec` | string | — | **Required.** Path or URL to the spec file. |
|
|
89
|
+
| `title` | string | `info.title` | Page H1. |
|
|
90
|
+
| `intro` | markdown | — | Shown between the title and metadata block. |
|
|
91
|
+
| `hide_version` | bool | `false` | Hide the version line. |
|
|
92
|
+
| `hide_internal` | bool | `false` | Drop `x-internal-only` properties. |
|
|
93
|
+
| `hide_download_link` | bool | `false` | Hide the spec download link. |
|
|
94
|
+
| `schema_depth` | int | `3` | Depth of dot-path flattening for nested object properties. |
|
|
95
|
+
| `attachments` | list | — | Extra files to copy and list in the downloads table. |
|
|
96
|
+
|
|
97
|
+
Renders: info, Servers, endpoints grouped by tag (parameters, request
|
|
98
|
+
body, responses, security), Schemas.
|
|
99
|
+
|
|
100
|
+
## Downloads & attachments
|
|
101
|
+
|
|
102
|
+
The resolved spec (external `$ref`s inlined) is written to
|
|
103
|
+
`assets/techdocs-owl-api/<page-slug>.json` and linked from a Downloads
|
|
104
|
+
table. Add extra files (e.g. `.proto` schemas) with `attachments`:
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
---
|
|
108
|
+
techdocs-owl-asyncapi:
|
|
109
|
+
spec: ../specs/asyncapi.yml
|
|
110
|
+
attachments:
|
|
111
|
+
- path: ../schemas/customer.proto
|
|
112
|
+
title: Customer Protobuf Schema
|
|
113
|
+
- ../schemas/order.proto # shorthand: path only, title = filename
|
|
114
|
+
---
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Error handling
|
|
118
|
+
|
|
119
|
+
Errors (missing/unreadable spec, network failures, parse errors, bad
|
|
120
|
+
frontmatter) render as a `!!! danger` admonition instead of failing the
|
|
121
|
+
build.
|
|
122
|
+
|
|
123
|
+
## Development
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
uv sync
|
|
127
|
+
uv run pytest
|
|
128
|
+
```
|