aboutsummaryrefslogtreecommitdiff
path: root/docs/source/_static
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-02-09 15:04:10 +0100
committerMatthew Heon <matthew.heon@pm.me>2022-02-10 14:03:58 -0500
commitd0fccbbbbad9b47a39827865f96a1b03e12ac303 (patch)
treeb16a7ef4ec70cad974430fd69d5c83d1d42382dd /docs/source/_static
parente7998b1224c78acbd4cb1ada2d7ac50f53001926 (diff)
downloadpodman-d0fccbbbbad9b47a39827865f96a1b03e12ac303.tar.gz
podman-d0fccbbbbad9b47a39827865f96a1b03e12ac303.tar.bz2
podman-d0fccbbbbad9b47a39827865f96a1b03e12ac303.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>