Skip to content

Commit bdd3f6f

Browse files
author
Maximilian Reißmann
committed
update note
1 parent ed5ad34 commit bdd3f6f

20 files changed

+3125
-0
lines changed

docs/build/api-reference.html

Lines changed: 178 additions & 0 deletions
Large diffs are not rendered by default.

docs/build/assets/documenter.js

Lines changed: 1193 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/assets/themes/catppuccin-frappe.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/assets/themes/catppuccin-latte.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/assets/themes/catppuccin-macchiato.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/assets/themes/catppuccin-mocha.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/assets/themes/documenter-dark.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/assets/themes/documenter-light.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/assets/themeswap.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Small function to quickly swap out themes. Gets put into the <head> tag..
2+
function set_theme_from_local_storage() {
3+
// Initialize the theme to null, which means default
4+
var theme = null;
5+
// If the browser supports the localstorage and is not disabled then try to get the
6+
// documenter theme
7+
if (window.localStorage != null) {
8+
// Get the user-picked theme from localStorage. May be `null`, which means the default
9+
// theme.
10+
theme = window.localStorage.getItem("documenter-theme");
11+
}
12+
// Check if the users preference is for dark color scheme
13+
var darkPreference =
14+
window.matchMedia("(prefers-color-scheme: dark)").matches === true;
15+
// Initialize a few variables for the loop:
16+
//
17+
// - active: will contain the index of the theme that should be active. Note that there
18+
// is no guarantee that localStorage contains sane values. If `active` stays `null`
19+
// we either could not find the theme or it is the default (primary) theme anyway.
20+
// Either way, we then need to stick to the primary theme.
21+
//
22+
// - disabled: style sheets that should be disabled (i.e. all the theme style sheets
23+
// that are not the currently active theme)
24+
var active = null;
25+
var disabled = [];
26+
var primaryLightTheme = null;
27+
var primaryDarkTheme = null;
28+
for (var i = 0; i < document.styleSheets.length; i++) {
29+
var ss = document.styleSheets[i];
30+
// The <link> tag of each style sheet is expected to have a data-theme-name attribute
31+
// which must contain the name of the theme. The names in localStorage much match this.
32+
var themename = ss.ownerNode.getAttribute("data-theme-name");
33+
// attribute not set => non-theme stylesheet => ignore
34+
if (themename === null) continue;
35+
// To distinguish the default (primary) theme, it needs to have the data-theme-primary
36+
// attribute set.
37+
if (ss.ownerNode.getAttribute("data-theme-primary") !== null) {
38+
primaryLightTheme = themename;
39+
}
40+
// Check if the theme is primary dark theme so that we could store its name in darkTheme
41+
if (ss.ownerNode.getAttribute("data-theme-primary-dark") !== null) {
42+
primaryDarkTheme = themename;
43+
}
44+
// If we find a matching theme (and it's not the default), we'll set active to non-null
45+
if (themename === theme) active = i;
46+
// Store the style sheets of inactive themes so that we could disable them
47+
if (themename !== theme) disabled.push(ss);
48+
}
49+
var activeTheme = null;
50+
if (active !== null) {
51+
// If we did find an active theme, we'll (1) add the theme--$(theme) class to <html>
52+
document.getElementsByTagName("html")[0].className = "theme--" + theme;
53+
activeTheme = theme;
54+
} else {
55+
// If we did _not_ find an active theme, then we need to fall back to the primary theme
56+
// which can either be dark or light, depending on the user's OS preference.
57+
var activeTheme = darkPreference ? primaryDarkTheme : primaryLightTheme;
58+
// In case it somehow happens that the relevant primary theme was not found in the
59+
// preceding loop, we abort without doing anything.
60+
if (activeTheme === null) {
61+
console.error("Unable to determine primary theme.");
62+
return;
63+
}
64+
// When switching to the primary light theme, then we must not have a class name
65+
// for the <html> tag. That's only for non-primary or the primary dark theme.
66+
if (darkPreference) {
67+
document.getElementsByTagName("html")[0].className =
68+
"theme--" + activeTheme;
69+
} else {
70+
document.getElementsByTagName("html")[0].className = "";
71+
}
72+
}
73+
for (var i = 0; i < document.styleSheets.length; i++) {
74+
var ss = document.styleSheets[i];
75+
// The <link> tag of each style sheet is expected to have a data-theme-name attribute
76+
// which must contain the name of the theme. The names in localStorage much match this.
77+
var themename = ss.ownerNode.getAttribute("data-theme-name");
78+
// attribute not set => non-theme stylesheet => ignore
79+
if (themename === null) continue;
80+
// we'll disable all the stylesheets, except for the active one
81+
ss.disabled = !(themename == activeTheme);
82+
}
83+
}
84+
set_theme_from_local_storage();

docs/build/assets/warner.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
function maybeAddWarning() {
2+
// DOCUMENTER_NEWEST is defined in versions.js, DOCUMENTER_CURRENT_VERSION and DOCUMENTER_STABLE
3+
// in siteinfo.js. DOCUMENTER_IS_DEV_VERSION is optional and defined in siteinfo.js.
4+
// If the required variables are undefined something went horribly wrong, so we abort.
5+
if (
6+
window.DOCUMENTER_NEWEST === undefined ||
7+
window.DOCUMENTER_CURRENT_VERSION === undefined ||
8+
window.DOCUMENTER_STABLE === undefined
9+
) {
10+
return;
11+
}
12+
13+
// Current version is not a version number, so we can't tell if it's the newest version. Abort.
14+
if (!/v(\d+\.)*\d+/.test(window.DOCUMENTER_CURRENT_VERSION)) {
15+
return;
16+
}
17+
18+
// Current version is newest version, so no need to add a warning.
19+
if (window.DOCUMENTER_NEWEST === window.DOCUMENTER_CURRENT_VERSION) {
20+
return;
21+
}
22+
23+
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs.
24+
if (document.body.querySelector('meta[name="robots"]') === null) {
25+
const meta = document.createElement("meta");
26+
meta.name = "robots";
27+
meta.content = "noindex";
28+
29+
document.getElementsByTagName("head")[0].appendChild(meta);
30+
}
31+
32+
const div = document.createElement("div");
33+
// Base class is added by default
34+
div.classList.add("warning-overlay-base");
35+
const closer = document.createElement("button");
36+
closer.classList.add("outdated-warning-closer", "delete");
37+
closer.addEventListener("click", function () {
38+
document.body.removeChild(div);
39+
});
40+
const href = window.documenterBaseURL + "/../" + window.DOCUMENTER_STABLE;
41+
42+
// Determine if this is a development version or an older release
43+
let warningMessage = "";
44+
if (window.DOCUMENTER_IS_DEV_VERSION === true) {
45+
div.classList.add("dev-warning-overlay");
46+
warningMessage =
47+
"This documentation is for the <strong>development version</strong> and may contain unstable or unreleased features.<br>";
48+
} else {
49+
div.classList.add("outdated-warning-overlay");
50+
warningMessage =
51+
"This documentation is for an <strong>older version</strong> that may be missing recent changes.<br>";
52+
}
53+
54+
warningMessage +=
55+
'<a href="' +
56+
href +
57+
'">Click here to go to the documentation for the latest stable release.</a>';
58+
59+
div.innerHTML = warningMessage;
60+
div.appendChild(closer);
61+
document.body.appendChild(div);
62+
}
63+
64+
if (document.readyState === "loading") {
65+
document.addEventListener("DOMContentLoaded", maybeAddWarning);
66+
} else {
67+
maybeAddWarning();
68+
}

0 commit comments

Comments
 (0)