//--- list of versions --- const versions = { "General": { "main": "6.1.1-dev22", "latest": "6.1.0", "v6.0.0": "6.0.0" }, "Core": { "latest": "6.1.0", "v6.0.0": "6.0.0" }, "Core_A": { "latest": "6.1.0", "v6.0.0": "6.0.0" }, "Driver": { "latest": "2.10.0", "v6.0.0": "2.9.0" }, "RTOS2": { "latest": "2.3.0" } } //--- list of versions --- const components = { "CMSIS": "General", "CMSIS-Core (Cortex-M)": "Core", "CMSIS-Core (Cortex-A)": "Core_A", "CMSIS-Driver": "Driver", "CMSIS-RTOS2": "RTOS2" } var script = document.currentScript if (script && script.src) { var scriptUrl = new URL(script.src); var docUrl = new URL(document.URL); var baseUrl = new URL(scriptUrl) baseUrl.pathname = baseUrl.pathname.split('/').slice(0,-1).join("/") function urlForVersion(url, version) { url = new URL(url); pathname = url.pathname.replace(baseUrl.pathname, ""); parts = pathname.split("/"); parts[1] = version; url.pathname = baseUrl.pathname + parts.join("/"); return url } function writeVersionDropdown(id) { component = components[id] currentVersion = document.currentScript.parentNode.innerText; document.currentScript.parentNode.classList.add("dropdown"); document.currentScript.parentNode.innerText = ""; document.write(' '+currentVersion+''); document.write('