summaryrefslogtreecommitdiff
path: root/docs/source/_static
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-02-09 15:04:10 +0100
committerPaul Holzinger <pholzing@redhat.com>2022-02-09 18:17:52 +0100
commit829f88d74d6eda471ea3fd4c83857d899a7e452c (patch)
tree064408d690613132d8067a409b026fdd187078ad /docs/source/_static
parenteb0a0db318a988af9ed70f3cc3a68f3b2bf2aa93 (diff)
downloadpodman-829f88d74d6eda471ea3fd4c83857d899a7e452c.tar.gz
podman-829f88d74d6eda471ea3fd4c83857d899a7e452c.tar.bz2
podman-829f88d74d6eda471ea3fd4c83857d899a7e452c.zip
Show API doc for several versions
Right now it is not possible to look at the API version for a specific version. docs.podman.io always show the latest version from the main branch. This is not want many users want so they now have the ability to select a different version. Fixes #12796 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'docs/source/_static')
-rw-r--r--docs/source/_static/api.html17
1 files changed, 16 insertions, 1 deletions
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>