diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-09 12:59:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 12:59:51 -0500 |
commit | cd9ec7f7c3da666b234e2f53ef52c0a4089373fd (patch) | |
tree | 064408d690613132d8067a409b026fdd187078ad /docs | |
parent | eb0a0db318a988af9ed70f3cc3a68f3b2bf2aa93 (diff) | |
parent | 829f88d74d6eda471ea3fd4c83857d899a7e452c (diff) | |
download | podman-cd9ec7f7c3da666b234e2f53ef52c0a4089373fd.tar.gz podman-cd9ec7f7c3da666b234e2f53ef52c0a4089373fd.tar.bz2 podman-cd9ec7f7c3da666b234e2f53ef52c0a4089373fd.zip |
Merge pull request #13182 from Luap99/api-doc
[CI:DOCS] Show API doc for several versions
Diffstat (limited to 'docs')
-rw-r--r-- | docs/source/Reference.rst | 14 | ||||
-rw-r--r-- | docs/source/_static/api.html | 17 |
2 files changed, 27 insertions, 4 deletions
diff --git a/docs/source/Reference.rst b/docs/source/Reference.rst index d194c55a3..dca49a559 100644 --- a/docs/source/Reference.rst +++ b/docs/source/Reference.rst @@ -3,8 +3,16 @@ Reference ========= -To see full screen version please visit: `API documentation <https://docs.podman.io/en/latest/_static/api.html>`_ +Show the API documentation for version: -.. raw:: html +* `latest (main branch) <_static/api.html>`_ - <iframe src="_static/api.html" allowfullscreen="true" height="600px" width="120%"></iframe> +* `version 4.0 <_static/api.html?version=v4.0>`_ + +* `version 3.4 <_static/api.html?version=v3.4>`_ + +* `version 3.3 <_static/api.html?version=v3.3>`_ + +* `version 3.2 <_static/api.html?version=v3.2>`_ + +* `version 3.1 <_static/api.html?version=v3.1>`_ diff --git a/docs/source/_static/api.html b/docs/source/_static/api.html index 6d467d099..0d2d2a8a1 100644 --- a/docs/source/_static/api.html +++ b/docs/source/_static/api.html @@ -18,7 +18,22 @@ </style> </head> <body> - <redoc spec-url='https://storage.googleapis.com/libpod-master-releases/swagger-latest.yaml' sort-props-alphabetically sort-operations-alphabetically></redoc> + <script> + // get version from query (default to latest) + var queryString = window.location.search; + var query = new URLSearchParams(queryString); + var version = "latest"; + if (query.has("version")) { + version = query.get("version"); + } + + var redoc = document.createElement("redoc"); + redoc.setAttribute("sort-props-alphabetically",""); + redoc.setAttribute("sort-operations-alphabetically",""); + redoc.setAttribute("spec-url","https://storage.googleapis.com/libpod-master-releases/swagger-" + version + ".yaml"); + + document.body.appendChild(redoc); + </script> <script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script> </body> </html> |