mirror of
https://github.com/containers/podman.git
synced 2025-11-29 01:28:22 +08:00
docs: initialize redoc via JS API
Preparation for the next commit in which we'll make the script tag async (in order to use await to fetch the new versions.json file). Signed-off-by: Martin Fischer <martin@push-f.com>
This commit is contained in:
@@ -18,6 +18,8 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
|
||||||
|
<div id="redoc-container"></div>
|
||||||
<script>
|
<script>
|
||||||
// get version from query (default to latest)
|
// get version from query (default to latest)
|
||||||
var queryString = window.location.search;
|
var queryString = window.location.search;
|
||||||
@@ -27,13 +29,10 @@
|
|||||||
version = query.get("version");
|
version = query.get("version");
|
||||||
}
|
}
|
||||||
|
|
||||||
var redoc = document.createElement("redoc");
|
Redoc.init("https://storage.googleapis.com/libpod-master-releases/swagger-" + version + ".yaml", {
|
||||||
redoc.setAttribute("sort-props-alphabetically","");
|
sortPropsAlphabetically: true,
|
||||||
redoc.setAttribute("sort-operations-alphabetically","");
|
sortOperationsAlphabetically: true,
|
||||||
redoc.setAttribute("spec-url","https://storage.googleapis.com/libpod-master-releases/swagger-" + version + ".yaml");
|
}, document.getElementById("redoc-container"));
|
||||||
|
|
||||||
document.body.appendChild(redoc);
|
|
||||||
</script>
|
</script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user