`;
let display_link =
result.location.slice(Math.max(0), Math.min(50, result.location.length)) +
- (result.location.length > 30 ? "..." : ""); // To cut-off the link because it messes with the overflow of the whole div
+ (result.location.length > 30 ? '...' : ''); // To cut-off the link because it messes with the overflow of the whole div
- if (result.page !== "") {
+ if (result.page !== '') {
display_link += ` (${result.page})`;
}
searchstring = escapeRegExp(querystring);
- let textindex = new RegExp(`${searchstring}`, "i").exec(result.text);
+ let textindex = new RegExp(`${searchstring}`, 'i').exec(result.text);
let text =
textindex !== null
? result.text.slice(
@@ -281,32 +281,32 @@ function worker_function(documenterSearchIndex, documenterBaseURL, filters) {
result.text.length
)
)
- : ""; // cut-off text before and after from the match
+ : ''; // cut-off text before and after from the match
- text = text.length ? escape(text) : "";
+ text = text.length ? escape(text) : '';
let display_result = text.length
- ? "..." +
+ ? '...' +
text.replace(
- new RegExp(`${escape(searchstring)}`, "i"), // For first occurrence
+ new RegExp(`${escape(searchstring)}`, 'i'), // For first occurrence
'$&'
) +
- "..."
- : ""; // highlights the match
+ '...'
+ : ''; // highlights the match
let in_code = false;
- if (!["page", "section"].includes(result.category.toLowerCase())) {
+ if (!['page', 'section'].includes(result.category.toLowerCase())) {
in_code = true;
}
// We encode the full url to escape some special characters which can lead to broken links
let result_div = `
@@ -544,10 +548,10 @@ function waitUntilSearchIndexAvailable() {
// has finished loading and documenterSearchIndex gets defined.
// So we need to wait until the search index actually loads before setting
// up all the search-related stuff.
- if (typeof documenterSearchIndex !== "undefined") {
+ if (typeof documenterSearchIndex !== 'undefined') {
runSearchMainCode();
} else {
- console.warn("Search Index not available, waiting");
+ console.warn('Search Index not available, waiting');
setTimeout(waitUntilSearchIndexAvailable, 1000);
}
}
diff --git a/assets/html/js/settings.js b/assets/html/js/settings.js
index 068e98efdf..53fbba9e15 100644
--- a/assets/html/js/settings.js
+++ b/assets/html/js/settings.js
@@ -3,16 +3,16 @@
// Modal settings dialog
$(document).ready(function () {
- var settings = $("#documenter-settings");
- $("#documenter-settings-button").click(function () {
- settings.toggleClass("is-active");
+ var settings = $('#documenter-settings');
+ $('#documenter-settings-button').click(function () {
+ settings.toggleClass('is-active');
});
// Close the dialog if X is clicked
- $("#documenter-settings button.delete").click(function () {
- settings.removeClass("is-active");
+ $('#documenter-settings button.delete').click(function () {
+ settings.removeClass('is-active');
});
// Close dialog if ESC is pressed
$(document).keyup(function (e) {
- if (e.keyCode == 27) settings.removeClass("is-active");
+ if (e.keyCode == 27) settings.removeClass('is-active');
});
});
diff --git a/assets/html/js/shortcut.js b/assets/html/js/shortcut.js
index 55bdc6f9c5..d45c44573c 100644
--- a/assets/html/js/shortcut.js
+++ b/assets/html/js/shortcut.js
@@ -47,24 +47,24 @@ $(document).ready(function () {
`
);
- document.querySelector(".docs-search-query").addEventListener("click", () => {
+ document.querySelector('.docs-search-query').addEventListener('click', () => {
openModal();
});
document
- .querySelector(".close-search-modal")
- .addEventListener("click", () => {
+ .querySelector('.close-search-modal')
+ .addEventListener('click', () => {
closeModal();
});
- $(document).on("click", ".search-result-link", function () {
+ $(document).on('click', '.search-result-link', function () {
closeModal();
});
- document.addEventListener("keydown", (event) => {
- if ((event.ctrlKey || event.metaKey) && event.key === "/") {
+ document.addEventListener('keydown', (event) => {
+ if ((event.ctrlKey || event.metaKey) && event.key === '/') {
openModal();
- } else if (event.key === "Escape") {
+ } else if (event.key === 'Escape') {
closeModal();
}
@@ -73,32 +73,32 @@ $(document).ready(function () {
// Functions to open and close a modal
function openModal() {
- let searchModal = document.querySelector("#search-modal");
+ let searchModal = document.querySelector('#search-modal');
- searchModal.classList.add("is-active");
- document.querySelector(".documenter-search-input").focus();
+ searchModal.classList.add('is-active');
+ document.querySelector('.documenter-search-input').focus();
}
function closeModal() {
- let searchModal = document.querySelector("#search-modal");
+ let searchModal = document.querySelector('#search-modal');
let initial_search_body = `
Type something to get started!
`;
- searchModal.classList.remove("is-active");
- document.querySelector(".documenter-search-input").blur();
+ searchModal.classList.remove('is-active');
+ document.querySelector('.documenter-search-input').blur();
- if (!$(".search-modal-card-body").hasClass("is-justify-content-center")) {
- $(".search-modal-card-body").addClass("is-justify-content-center");
+ if (!$('.search-modal-card-body').hasClass('is-justify-content-center')) {
+ $('.search-modal-card-body').addClass('is-justify-content-center');
}
- $(".documenter-search-input").val("");
- $(".search-modal-card-body").html(initial_search_body);
+ $('.documenter-search-input').val('');
+ $('.search-modal-card-body').html(initial_search_body);
}
document
- .querySelector("#search-modal .modal-background")
- .addEventListener("click", () => {
+ .querySelector('#search-modal .modal-background')
+ .addEventListener('click', () => {
closeModal();
});
});
diff --git a/assets/html/js/sidebar.js b/assets/html/js/sidebar.js
index 6e01092d0a..459cbaab86 100644
--- a/assets/html/js/sidebar.js
+++ b/assets/html/js/sidebar.js
@@ -3,22 +3,22 @@
// Manages the showing and hiding of the sidebar.
$(document).ready(function () {
- var sidebar = $("#documenter > .docs-sidebar");
- var sidebar_button = $("#documenter-sidebar-button");
+ var sidebar = $('#documenter > .docs-sidebar');
+ var sidebar_button = $('#documenter-sidebar-button');
sidebar_button.click(function (ev) {
ev.preventDefault();
- sidebar.toggleClass("visible");
- if (sidebar.hasClass("visible")) {
+ sidebar.toggleClass('visible');
+ if (sidebar.hasClass('visible')) {
// Makes sure that the current menu item is visible in the sidebar.
- $("#documenter .docs-menu a.is-active").focus();
+ $('#documenter .docs-menu a.is-active').focus();
}
});
- $("#documenter > .docs-main").bind("click", function (ev) {
+ $('#documenter > .docs-main').bind('click', function (ev) {
if ($(ev.target).is(sidebar_button)) {
return;
}
- if (sidebar.hasClass("visible")) {
- sidebar.removeClass("visible");
+ if (sidebar.hasClass('visible')) {
+ sidebar.removeClass('visible');
}
});
});
@@ -26,27 +26,27 @@ $(document).ready(function () {
// Resizes the package name / sitename in the sidebar if it is too wide.
// Inspired by: https://github.com/davatron5000/FitText.js
$(document).ready(function () {
- e = $("#documenter .docs-autofit");
+ e = $('#documenter .docs-autofit');
function resize() {
- var L = parseInt(e.css("max-width"), 10);
+ var L = parseInt(e.css('max-width'), 10);
var L0 = e.width();
if (L0 > L) {
- var h0 = parseInt(e.css("font-size"), 10);
- e.css("font-size", (L * h0) / L0);
+ var h0 = parseInt(e.css('font-size'), 10);
+ e.css('font-size', (L * h0) / L0);
// TODO: make sure it survives resizes?
}
}
// call once and then register events
resize();
$(window).resize(resize);
- $(window).on("orientationchange", resize);
+ $(window).on('orientationchange', resize);
});
// Scroll the navigation bar to the currently selected menu item
$(document).ready(function () {
- var sidebar = $("#documenter .docs-menu").get(0);
- var active = $("#documenter .docs-menu .is-active").get(0);
- if (typeof active !== "undefined") {
+ var sidebar = $('#documenter .docs-menu').get(0);
+ var active = $('#documenter .docs-menu .is-active').get(0);
+ if (typeof active !== 'undefined') {
sidebar.scrollTop = active.offsetTop - sidebar.offsetTop - 15;
}
});
diff --git a/assets/html/js/themes.js b/assets/html/js/themes.js
index 7ecd649552..3647f568e2 100644
--- a/assets/html/js/themes.js
+++ b/assets/html/js/themes.js
@@ -4,14 +4,14 @@
// Theme picker setup
$(document).ready(function () {
// onchange callback
- $("#documenter-themepicker").change(function themepick_callback(ev) {
- var themename = $("#documenter-themepicker option:selected").attr("value");
- if (themename === "auto") {
+ $('#documenter-themepicker').change(function themepick_callback(ev) {
+ var themename = $('#documenter-themepicker option:selected').attr('value');
+ if (themename === 'auto') {
// set_theme(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
- window.localStorage.removeItem("documenter-theme");
+ window.localStorage.removeItem('documenter-theme');
} else {
// set_theme(themename);
- window.localStorage.setItem("documenter-theme", themename);
+ window.localStorage.setItem('documenter-theme', themename);
}
// We re-use the global function from themeswap.js to actually do the swapping.
set_theme_from_local_storage();
@@ -19,10 +19,10 @@ $(document).ready(function () {
// Make sure that the themepicker displays the correct theme when the theme is retrieved
// from localStorage
- if (typeof window.localStorage !== "undefined") {
- var theme = window.localStorage.getItem("documenter-theme");
+ if (typeof window.localStorage !== 'undefined') {
+ var theme = window.localStorage.getItem('documenter-theme');
if (theme !== null) {
- $("#documenter-themepicker option").each(function (i, e) {
+ $('#documenter-themepicker option').each(function (i, e) {
e.selected = e.value === theme;
});
}
diff --git a/assets/html/js/versions.js b/assets/html/js/versions.js
index 40cbb37f21..c068d34e04 100644
--- a/assets/html/js/versions.js
+++ b/assets/html/js/versions.js
@@ -6,48 +6,48 @@ $(document).ready(function () {
// If the version selector is disabled with DOCUMENTER_VERSION_SELECTOR_DISABLED in the
// siteinfo.js file, we just return immediately and not display the version selector.
if (
- typeof DOCUMENTER_VERSION_SELECTOR_DISABLED === "boolean" &&
+ typeof DOCUMENTER_VERSION_SELECTOR_DISABLED === 'boolean' &&
DOCUMENTER_VERSION_SELECTOR_DISABLED
) {
return;
}
- var version_selector = $("#documenter .docs-version-selector");
- var version_selector_select = $("#documenter .docs-version-selector select");
+ var version_selector = $('#documenter .docs-version-selector');
+ var version_selector_select = $('#documenter .docs-version-selector select');
version_selector_select.change(function (x) {
target_href = version_selector_select
- .children("option:selected")
+ .children('option:selected')
.get(0).value;
window.location.href = target_href;
});
// add the current version to the selector based on siteinfo.js, but only if the selector is empty
if (
- typeof DOCUMENTER_CURRENT_VERSION !== "undefined" &&
- $("#version-selector > option").length == 0
+ typeof DOCUMENTER_CURRENT_VERSION !== 'undefined' &&
+ $('#version-selector > option').length == 0
) {
var option = $(
""
+ ''
);
version_selector_select.append(option);
}
- if (typeof DOC_VERSIONS !== "undefined") {
- var existing_versions = version_selector_select.children("option");
+ if (typeof DOC_VERSIONS !== 'undefined') {
+ var existing_versions = version_selector_select.children('option');
var existing_versions_texts = existing_versions.map(function (i, x) {
return x.text;
});
DOC_VERSIONS.forEach(function (each) {
- var version_url = documenterBaseURL + "/../" + each + "/";
+ var version_url = documenterBaseURL + '/../' + each + '/';
var existing_id = $.inArray(each, existing_versions_texts);
// if not already in the version selector, add it as a new option,
// otherwise update the old option with the URL and enable it
if (existing_id == -1) {
var option = $(
- ""
+ "'
);
version_selector_select.append(option);
} else {
@@ -59,7 +59,7 @@ $(document).ready(function () {
}
// only show the version selector if the selector has been populated
- if (version_selector_select.children("option").length > 0) {
- version_selector.toggleClass("visible");
+ if (version_selector_select.children('option').length > 0) {
+ version_selector.toggleClass('visible');
}
});
diff --git a/assets/html/themeswap.js b/assets/html/themeswap.js
index 9f5eebe6aa..2096a8bf2f 100644
--- a/assets/html/themeswap.js
+++ b/assets/html/themeswap.js
@@ -7,11 +7,11 @@ function set_theme_from_local_storage() {
if (window.localStorage != null) {
// Get the user-picked theme from localStorage. May be `null`, which means the default
// theme.
- theme = window.localStorage.getItem("documenter-theme");
+ theme = window.localStorage.getItem('documenter-theme');
}
// Check if the users preference is for dark color scheme
var darkPreference =
- window.matchMedia("(prefers-color-scheme: dark)").matches === true;
+ window.matchMedia('(prefers-color-scheme: dark)').matches === true;
// Initialize a few variables for the loop:
//
// - active: will contain the index of the theme that should be active. Note that there
@@ -29,16 +29,16 @@ function set_theme_from_local_storage() {
var ss = document.styleSheets[i];
// The tag of each style sheet is expected to have a data-theme-name attribute
// which must contain the name of the theme. The names in localStorage much match this.
- var themename = ss.ownerNode.getAttribute("data-theme-name");
+ var themename = ss.ownerNode.getAttribute('data-theme-name');
// attribute not set => non-theme stylesheet => ignore
if (themename === null) continue;
// To distinguish the default (primary) theme, it needs to have the data-theme-primary
// attribute set.
- if (ss.ownerNode.getAttribute("data-theme-primary") !== null) {
+ if (ss.ownerNode.getAttribute('data-theme-primary') !== null) {
primaryLightTheme = themename;
}
// Check if the theme is primary dark theme so that we could store its name in darkTheme
- if (ss.ownerNode.getAttribute("data-theme-primary-dark") !== null) {
+ if (ss.ownerNode.getAttribute('data-theme-primary-dark') !== null) {
primaryDarkTheme = themename;
}
// If we find a matching theme (and it's not the default), we'll set active to non-null
@@ -49,7 +49,7 @@ function set_theme_from_local_storage() {
var activeTheme = null;
if (active !== null) {
// If we did find an active theme, we'll (1) add the theme--$(theme) class to
- document.getElementsByTagName("html")[0].className = "theme--" + theme;
+ document.getElementsByTagName('html')[0].className = 'theme--' + theme;
activeTheme = theme;
} else {
// If we did _not_ find an active theme, then we need to fall back to the primary theme
@@ -58,23 +58,23 @@ function set_theme_from_local_storage() {
// In case it somehow happens that the relevant primary theme was not found in the
// preceding loop, we abort without doing anything.
if (activeTheme === null) {
- console.error("Unable to determine primary theme.");
+ console.error('Unable to determine primary theme.');
return;
}
// When switching to the primary light theme, then we must not have a class name
// for the tag. That's only for non-primary or the primary dark theme.
if (darkPreference) {
- document.getElementsByTagName("html")[0].className =
- "theme--" + activeTheme;
+ document.getElementsByTagName('html')[0].className =
+ 'theme--' + activeTheme;
} else {
- document.getElementsByTagName("html")[0].className = "";
+ document.getElementsByTagName('html')[0].className = '';
}
}
for (var i = 0; i < document.styleSheets.length; i++) {
var ss = document.styleSheets[i];
// The tag of each style sheet is expected to have a data-theme-name attribute
// which must contain the name of the theme. The names in localStorage much match this.
- var themename = ss.ownerNode.getAttribute("data-theme-name");
+ var themename = ss.ownerNode.getAttribute('data-theme-name');
// attribute not set => non-theme stylesheet => ignore
if (themename === null) continue;
// we'll disable all the stylesheets, except for the active one
diff --git a/assets/html/warner.js b/assets/html/warner.js
index 3f6f5d0083..2f4a2ec760 100644
--- a/assets/html/warner.js
+++ b/assets/html/warner.js
@@ -22,21 +22,21 @@ function maybeAddWarning() {
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs.
if (document.body.querySelector('meta[name="robots"]') === null) {
- const meta = document.createElement("meta");
- meta.name = "robots";
- meta.content = "noindex";
+ const meta = document.createElement('meta');
+ meta.name = 'robots';
+ meta.content = 'noindex';
- document.getElementsByTagName("head")[0].appendChild(meta);
+ document.getElementsByTagName('head')[0].appendChild(meta);
}
- const div = document.createElement("div");
- div.classList.add("outdated-warning-overlay");
- const closer = document.createElement("button");
- closer.classList.add("outdated-warning-closer", "delete");
- closer.addEventListener("click", function () {
+ const div = document.createElement('div');
+ div.classList.add('outdated-warning-overlay');
+ const closer = document.createElement('button');
+ closer.classList.add('outdated-warning-closer', 'delete');
+ closer.addEventListener('click', function () {
document.body.removeChild(div);
});
- const href = window.documenterBaseURL + "/../" + window.DOCUMENTER_STABLE;
+ const href = window.documenterBaseURL + '/../' + window.DOCUMENTER_STABLE;
div.innerHTML =
'This documentation is not for the latest stable release, but for either the development version or an older release. =14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000000..c2436a9f75
--- /dev/null
+++ b/package.json
@@ -0,0 +1,5 @@
+{
+ "devDependencies": {
+ "prettier": "^3.3.3"
+ }
+}