Reformat code with automated tools

Apply standardized code style
This commit is contained in:
medmunds
2023-02-06 12:27:43 -08:00
committed by Mike Edmunds
parent 40891fcb4a
commit b4e22c63b3
94 changed files with 12936 additions and 7443 deletions

View File

@@ -4,31 +4,35 @@
// but adds admonition for the "latest" version -- which is (unreleased) main branch.
function warnOnLatestVersion() {
// The warning text and link is really specific to RTD hosting,
// so we can just check their global to determine version:
if (!window.READTHEDOCS_DATA || window.READTHEDOCS_DATA.version !== "latest") {
return; // not latest, or not on RTD
return; // not latest, or not on RTD
}
var warning = document.createElement('div');
warning.setAttribute('class', 'admonition danger');
warning.innerHTML = "<p class='first admonition-title'>Note</p> " +
var warning = document.createElement("div");
warning.setAttribute("class", "admonition danger");
warning.innerHTML =
"<p class='first admonition-title'>Note</p> " +
"<p class='last'> " +
"This document is for an <strong>unreleased development version</strong>. " +
"Documentation is available for the <a href='/en/stable/'>current stable release</a>, " +
"or for older versions through the &ldquo;v:&rdquo; menu at bottom left." +
"</p>";
warning.querySelector('a').href = window.location.pathname.replace('/latest', '/stable');
warning.querySelector("a").href = window.location.pathname.replace(
"/latest",
"/stable"
);
var parent = document.querySelector('div.body')
|| document.querySelector('div.document')
|| document.body;
var parent =
document.querySelector("div.body") ||
document.querySelector("div.document") ||
document.body;
parent.insertBefore(warning, parent.firstChild);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', warnOnLatestVersion);
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", warnOnLatestVersion);
} else {
warnOnLatestVersion();
}