Update docs

This commit is contained in:
2025-11-05 09:58:25 -06:00
parent 742f628bd8
commit 905437c9f7
24 changed files with 1200 additions and 757 deletions

View File

@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-21T10:56:56","documenter_version":"1.2.1"}} {"documenter":{"julia_version":"1.12.1","generation_timestamp":"2025-11-05T09:58:10","documenter_version":"1.15.0"}}

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,6 @@ requirejs.config({
'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/julia.min', 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/julia.min',
'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min', 'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min',
'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min', 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min',
'minisearch': 'https://cdn.jsdelivr.net/npm/minisearch@6.1.0/dist/umd/index.min',
'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/contrib/auto-render.min', 'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/contrib/auto-render.min',
'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min', 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min',
'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min', 'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min',
@@ -78,48 +77,54 @@ require(['jquery'], function($) {
let timer = 0; let timer = 0;
var isExpanded = true; var isExpanded = true;
$(document).on("click", ".docstring header", function () { $(document).on(
"click",
".docstring .docstring-article-toggle-button",
function () {
let articleToggleTitle = "Expand docstring"; let articleToggleTitle = "Expand docstring";
const parent = $(this).parent();
debounce(() => { debounce(() => {
if ($(this).siblings("section").is(":visible")) { if (parent.siblings("section").is(":visible")) {
$(this) parent
.find(".docstring-article-toggle-button") .find("a.docstring-article-toggle-button")
.removeClass("fa-chevron-down") .removeClass("fa-chevron-down")
.addClass("fa-chevron-right"); .addClass("fa-chevron-right");
} else { } else {
$(this) parent
.find(".docstring-article-toggle-button") .find("a.docstring-article-toggle-button")
.removeClass("fa-chevron-right") .removeClass("fa-chevron-right")
.addClass("fa-chevron-down"); .addClass("fa-chevron-down");
articleToggleTitle = "Collapse docstring"; articleToggleTitle = "Collapse docstring";
} }
$(this) parent
.find(".docstring-article-toggle-button") .children(".docstring-article-toggle-button")
.prop("title", articleToggleTitle); .prop("title", articleToggleTitle);
$(this).siblings("section").slideToggle(); parent.siblings("section").slideToggle();
});
}); });
},
);
$(document).on("click", ".docs-article-toggle-button", function () { $(document).on("click", ".docs-article-toggle-button", function (event) {
let articleToggleTitle = "Expand docstring"; let articleToggleTitle = "Expand docstring";
let navArticleToggleTitle = "Expand all docstrings"; let navArticleToggleTitle = "Expand all docstrings";
let animationSpeed = event.noToggleAnimation ? 0 : 400;
debounce(() => { debounce(() => {
if (isExpanded) { if (isExpanded) {
$(this).removeClass("fa-chevron-up").addClass("fa-chevron-down"); $(this).removeClass("fa-chevron-up").addClass("fa-chevron-down");
$(".docstring-article-toggle-button") $("a.docstring-article-toggle-button")
.removeClass("fa-chevron-down") .removeClass("fa-chevron-down")
.addClass("fa-chevron-right"); .addClass("fa-chevron-right");
isExpanded = false; isExpanded = false;
$(".docstring section").slideUp(); $(".docstring section").slideUp(animationSpeed);
} else { } else {
$(this).removeClass("fa-chevron-down").addClass("fa-chevron-up"); $(this).removeClass("fa-chevron-down").addClass("fa-chevron-up");
$(".docstring-article-toggle-button") $("a.docstring-article-toggle-button")
.removeClass("fa-chevron-right") .removeClass("fa-chevron-right")
.addClass("fa-chevron-down"); .addClass("fa-chevron-down");
@@ -127,7 +132,7 @@ $(document).on("click", ".docs-article-toggle-button", function () {
articleToggleTitle = "Collapse docstring"; articleToggleTitle = "Collapse docstring";
navArticleToggleTitle = "Collapse all docstrings"; navArticleToggleTitle = "Collapse all docstrings";
$(".docstring section").slideDown(); $(".docstring section").slideDown(animationSpeed);
} }
$(this).prop("title", navArticleToggleTitle); $(this).prop("title", navArticleToggleTitle);
@@ -224,15 +229,107 @@ $(document).ready(function () {
}) })
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
require(['jquery', 'minisearch'], function($, minisearch) { require(['jquery'], function($) {
// In general, most search related things will have "search" as a prefix. $(document).ready(function () {
// To get an in-depth about the thought process you can refer: https://hetarth02.hashnode.dev/series/gsoc let meta = $("div[data-docstringscollapsed]").data();
let results = []; if (meta?.docstringscollapsed) {
let timer = undefined; $("#documenter-article-toggle-button").trigger({
type: "click",
noToggleAnimation: true,
});
let data = documenterSearchIndex["docs"].map((x, key) => { setTimeout(function () {
if (window.location.hash) {
const targetId = window.location.hash.substring(1);
const targetElement = document.getElementById(targetId);
if (targetElement) {
targetElement.scrollIntoView({
behavior: "smooth",
block: "center",
});
}
}
}, 100);
}
});
})
////////////////////////////////////////////////////////////////////////////////
require(['jquery'], function($) {
/*
To get an in-depth about the thought process you can refer: https://hetarth02.hashnode.dev/series/gsoc
PSEUDOCODE:
Searching happens automatically as the user types or adjusts the selected filters.
To preserve responsiveness, as much as possible of the slow parts of the search are done
in a web worker. Searching and result generation are done in the worker, and filtering and
DOM updates are done in the main thread. The filters are in the main thread as they should
be very quick to apply. This lets filters be changed without re-searching with minisearch
(which is possible even if filtering is on the worker thread) and also lets filters be
changed _while_ the worker is searching and without message passing (neither of which are
possible if filtering is on the worker thread)
SEARCH WORKER:
Import minisearch
Build index
On message from main thread
run search
find the first 200 unique results from each category, and compute their divs for display
note that this is necessary and sufficient information for the main thread to find the
first 200 unique results from any given filter set
post results to main thread
MAIN:
Launch worker
Declare nonconstant globals (worker_is_running, last_search_text, unfiltered_results)
On text update
if worker is not running, launch_search()
launch_search
set worker_is_running to true, set last_search_text to the search text
post the search query to worker
on message from worker
if last_search_text is not the same as the text in the search field,
the latest search result is not reflective of the latest search query, so update again
launch_search()
otherwise
set worker_is_running to false
regardless, display the new search results to the user
save the unfiltered_results as a global
update_search()
on filter click
adjust the filter selection
update_search()
update_search
apply search filters by looping through the unfiltered_results and finding the first 200
unique results that match the filters
Update the DOM
*/
/////// SEARCH WORKER ///////
function worker_function(documenterSearchIndex, documenterBaseURL, filters) {
importScripts(
"https://cdn.jsdelivr.net/npm/minisearch@6.1.0/dist/umd/index.min.js",
);
let data = documenterSearchIndex.map((x, key) => {
x["id"] = key; // minisearch requires a unique for each object x["id"] = key; // minisearch requires a unique for each object
return x; return x;
}); });
@@ -348,9 +445,9 @@ const stopWords = new Set([
"your", "your",
]); ]);
let index = new minisearch({ let index = new MiniSearch({
fields: ["title", "text"], // fields to index for full-text search fields: ["title", "text"], // fields to index for full-text search
storeFields: ["location", "title", "text", "category", "page"], // fields to return with search results storeFields: ["location", "title", "text", "category", "page"], // fields to return with results
processTerm: (term) => { processTerm: (term) => {
let word = stopWords.has(term) ? null : term; let word = stopWords.has(term) ? null : term;
if (word) { if (word) {
@@ -358,90 +455,307 @@ let index = new minisearch({
word = word word = word
.replace(/^[^a-zA-Z0-9@!]+/, "") .replace(/^[^a-zA-Z0-9@!]+/, "")
.replace(/[^a-zA-Z0-9@!]+$/, ""); .replace(/[^a-zA-Z0-9@!]+$/, "");
word = word.toLowerCase();
} }
return word ?? null; return word ?? null;
}, },
// add . as a separator, because otherwise "title": "Documenter.Anchors.add!", would not find anything if searching for "add!", only for the entire qualification // add . as a separator, because otherwise "title": "Documenter.Anchors.add!", would not
// find anything if searching for "add!", only for the entire qualification
tokenize: (string) => string.split(/[\s\-\.]+/), tokenize: (string) => string.split(/[\s\-\.]+/),
// options which will be applied during the search // options which will be applied during the search
searchOptions: { searchOptions: {
prefix: true,
boost: { title: 100 }, boost: { title: 100 },
fuzzy: 2, fuzzy: 2,
processTerm: (term) => {
let word = stopWords.has(term) ? null : term;
if (word) {
word = word
.replace(/^[^a-zA-Z0-9@!]+/, "")
.replace(/[^a-zA-Z0-9@!]+$/, "");
}
return word ?? null;
},
tokenize: (string) => string.split(/[\s\-\.]+/),
}, },
}); });
index.addAll(data); index.addAll(data);
let filters = [...new Set(data.map((x) => x.category))]; /**
var modal_filters = make_modal_body_filters(filters); * Used to map characters to HTML entities.
var filter_results = []; * Refer: https://github.com/lodash/lodash/blob/main/src/escape.ts
*/
$(document).on("keyup", ".documenter-search-input", function (event) { const htmlEscapes = {
// Adding a debounce to prevent disruptions from super-speed typing! "&": "&",
debounce(() => update_search(filter_results), 300); "<": "&lt;",
}); ">": "&gt;",
'"': "&quot;",
$(document).on("click", ".search-filter", function () { "'": "&#39;",
if ($(this).hasClass("search-filter-selected")) { };
$(this).removeClass("search-filter-selected");
} else {
$(this).addClass("search-filter-selected");
}
// Adding a debounce to prevent disruptions from crazy clicking!
debounce(() => get_filters(), 300);
});
/** /**
* A debounce function, takes a function and an optional timeout in milliseconds * Used to match HTML entities and HTML characters.
* * Refer: https://github.com/lodash/lodash/blob/main/src/escape.ts
* @function callback
* @param {number} timeout
*/ */
function debounce(callback, timeout = 300) { const reUnescapedHtml = /[&<>"']/g;
clearTimeout(timer); const reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
timer = setTimeout(callback, timeout);
/**
* Escape function from lodash
* Refer: https://github.com/lodash/lodash/blob/main/src/escape.ts
*/
function escape(string) {
return string && reHasUnescapedHtml.test(string)
? string.replace(reUnescapedHtml, (chr) => htmlEscapes[chr])
: string || "";
} }
/**
* RegX escape function from MDN
* Refer: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping
*/
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
}
/**
* Make the result component given a minisearch result data object and the value
* of the search input as queryString. To view the result object structure, refer:
* https://lucaong.github.io/minisearch/modules/_minisearch_.html#searchresult
*
* @param {object} result
* @param {string} querystring
* @returns string
*/
function make_search_result(result, querystring) {
let search_divider = `<div class="search-divider w-100"></div>`;
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
if (result.page !== "") {
display_link += ` (${result.page})`;
}
searchstring = escapeRegExp(querystring);
let textindex = new RegExp(`${searchstring}`, "i").exec(result.text);
let text =
textindex !== null
? result.text.slice(
Math.max(textindex.index - 100, 0),
Math.min(
textindex.index + querystring.length + 100,
result.text.length,
),
)
: ""; // cut-off text before and after from the match
text = text.length ? escape(text) : "";
let display_result = text.length
? "..." +
text.replace(
new RegExp(`${escape(searchstring)}`, "i"), // For first occurrence
'<span class="search-result-highlight py-1">$&</span>',
) +
"..."
: ""; // highlights the match
let in_code = false;
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 = `
<a href="${encodeURI(
documenterBaseURL + "/" + result.location,
)}" class="search-result-link w-100 is-flex is-flex-direction-column gap-2 px-4 py-2">
<div class="w-100 is-flex is-flex-wrap-wrap is-justify-content-space-between is-align-items-flex-start">
<div class="search-result-title has-text-weight-bold ${
in_code ? "search-result-code-title" : ""
}">${escape(result.title)}</div>
<div class="property-search-result-badge">${result.category}</div>
</div>
<p>
${display_result}
</p>
<div
class="has-text-left"
style="font-size: smaller;"
title="${result.location}"
>
<i class="fas fa-link"></i> ${display_link}
</div>
</a>
${search_divider}
`;
return result_div;
}
self.onmessage = function (e) {
let query = e.data;
let results = index.search(query, {
filter: (result) => {
// Only return relevant results
return result.score >= 1;
},
combineWith: "AND",
});
// Pre-filter to deduplicate and limit to 200 per category to the extent
// possible without knowing what the filters are.
let filtered_results = [];
let counts = {};
for (let filter of filters) {
counts[filter] = 0;
}
let present = {};
for (let result of results) {
cat = result.category;
cnt = counts[cat];
if (cnt < 200) {
id = cat + "---" + result.location;
if (present[id]) {
continue;
}
present[id] = true;
filtered_results.push({
location: result.location,
category: cat,
div: make_search_result(result, query),
});
}
}
postMessage(filtered_results);
};
}
/////// SEARCH MAIN ///////
function runSearchMainCode() {
// `worker = Threads.@spawn worker_function(documenterSearchIndex)`, but in JavaScript!
const filters = [
...new Set(documenterSearchIndex["docs"].map((x) => x.category)),
];
const worker_str =
"(" +
worker_function.toString() +
")(" +
JSON.stringify(documenterSearchIndex["docs"]) +
"," +
JSON.stringify(documenterBaseURL) +
"," +
JSON.stringify(filters) +
")";
const worker_blob = new Blob([worker_str], { type: "text/javascript" });
const worker = new Worker(URL.createObjectURL(worker_blob));
// Whether the worker is currently handling a search. This is a boolean
// as the worker only ever handles 1 or 0 searches at a time.
var worker_is_running = false;
// The last search text that was sent to the worker. This is used to determine
// if the worker should be launched again when it reports back results.
var last_search_text = "";
// The results of the last search. This, in combination with the state of the filters
// in the DOM, is used compute the results to display on calls to update_search.
var unfiltered_results = [];
// Which filter is currently selected
var selected_filter = "";
document.addEventListener("reset-filter", function () {
selected_filter = "";
update_search();
});
//update the url with search query
function updateSearchURL(query) {
const url = new URL(window.location);
if (query && query.trim() !== "") {
url.searchParams.set("q", query);
} else {
// remove the 'q' param if it exists
if (url.searchParams.has("q")) {
url.searchParams.delete("q");
}
}
// Add or remove the filter parameter based on selected_filter
if (selected_filter && selected_filter.trim() !== "") {
url.searchParams.set("filter", selected_filter);
} else {
// remove the 'filter' param if it exists
if (url.searchParams.has("filter")) {
url.searchParams.delete("filter");
}
}
// Only update history if there are parameters, otherwise use the base URL
if (url.search) {
window.history.replaceState({}, "", url);
} else {
window.history.replaceState({}, "", url.pathname + url.hash);
}
}
$(document).on("input", ".documenter-search-input", function (event) {
if (!worker_is_running) {
launch_search();
}
});
function launch_search() {
worker_is_running = true;
last_search_text = $(".documenter-search-input").val();
updateSearchURL(last_search_text);
worker.postMessage(last_search_text);
}
worker.onmessage = function (e) {
if (last_search_text !== $(".documenter-search-input").val()) {
launch_search();
} else {
worker_is_running = false;
}
unfiltered_results = e.data;
update_search();
};
$(document).on("click", ".search-filter", function () {
let search_input = $(".documenter-search-input");
let cursor_position = search_input[0].selectionStart;
if ($(this).hasClass("search-filter-selected")) {
selected_filter = "";
} else {
selected_filter = $(this).text().toLowerCase();
}
// This updates search results and toggles classes for UI:
update_search();
search_input.focus();
search_input.setSelectionRange(cursor_position, cursor_position);
});
/** /**
* Make/Update the search component * Make/Update the search component
*
* @param {string[]} selected_filters
*/ */
function update_search(selected_filters = []) { function update_search() {
let initial_search_body = `
<div class="has-text-centered my-5 py-5">Type something to get started!</div>
`;
let querystring = $(".documenter-search-input").val(); let querystring = $(".documenter-search-input").val();
updateSearchURL(querystring);
if (querystring.trim()) { if (querystring.trim()) {
results = index.search(querystring, { if (selected_filter == "") {
filter: (result) => { results = unfiltered_results;
// Filtering results
if (selected_filters.length === 0) {
return result.score >= 1;
} else { } else {
return ( results = unfiltered_results.filter((result) => {
result.score >= 1 && selected_filters.includes(result.category) return selected_filter == result.category.toLowerCase();
);
}
},
}); });
}
let search_result_container = ``; let search_result_container = ``;
let modal_filters = make_modal_body_filters();
let search_divider = `<div class="search-divider w-100"></div>`; let search_divider = `<div class="search-divider w-100"></div>`;
if (results.length) { if (results.length) {
@@ -449,19 +763,23 @@ function update_search(selected_filters = []) {
let count = 0; let count = 0;
let search_results = ""; let search_results = "";
results.forEach(function (result) { for (var i = 0, n = results.length; i < n && count < 200; ++i) {
if (result.location) { let result = results[i];
// Checking for duplication of results for the same page if (result.location && !links.includes(result.location)) {
if (!links.includes(result.location)) { search_results += result.div;
search_results += make_search_result(result, querystring);
count++; count++;
}
links.push(result.location); links.push(result.location);
} }
}); }
let result_count = `<div class="is-size-6">${count} result(s)</div>`; if (count == 1) {
count_str = "1 result";
} else if (count == 200) {
count_str = "200+ results";
} else {
count_str = count + " results";
}
let result_count = `<div class="is-size-6">${count_str}</div>`;
search_result_container = ` search_result_container = `
<div class="is-flex is-flex-direction-column gap-2 is-align-items-flex-start"> <div class="is-flex is-flex-direction-column gap-2 is-align-items-flex-start">
@@ -490,126 +808,76 @@ function update_search(selected_filters = []) {
$(".search-modal-card-body").html(search_result_container); $(".search-modal-card-body").html(search_result_container);
} else { } else {
filter_results = [];
modal_filters = make_modal_body_filters(filters, filter_results);
if (!$(".search-modal-card-body").hasClass("is-justify-content-center")) { if (!$(".search-modal-card-body").hasClass("is-justify-content-center")) {
$(".search-modal-card-body").addClass("is-justify-content-center"); $(".search-modal-card-body").addClass("is-justify-content-center");
} }
$(".search-modal-card-body").html(initial_search_body); $(".search-modal-card-body").html(`
<div class="has-text-centered my-5 py-5">Type something to get started!</div>
`);
} }
} }
//url param checking
function checkURLForSearch() {
const urlParams = new URLSearchParams(window.location.search);
const searchQuery = urlParams.get("q");
const filterParam = urlParams.get("filter");
// Set the selected filter if present in URL
if (filterParam) {
selected_filter = filterParam.toLowerCase();
}
// Trigger input event if there's a search query to perform the search
if (searchQuery) {
$(".documenter-search-input").val(searchQuery).trigger("input");
}
}
setTimeout(checkURLForSearch, 100);
/** /**
* Make the modal filter html * Make the modal filter html
* *
* @param {string[]} filters
* @param {string[]} selected_filters
* @returns string * @returns string
*/ */
function make_modal_body_filters(filters, selected_filters = []) { function make_modal_body_filters() {
let str = ``; let str = filters
.map((val) => {
filters.forEach((val) => { if (selected_filter == val.toLowerCase()) {
if (selected_filters.includes(val)) { return `<a href="javascript:;" class="search-filter search-filter-selected"><span>${val}</span></a>`;
str += `<a href="javascript:;" class="search-filter search-filter-selected"><span>${val}</span></a>`;
} else { } else {
str += `<a href="javascript:;" class="search-filter"><span>${val}</span></a>`; return `<a href="javascript:;" class="search-filter"><span>${val}</span></a>`;
} }
}); })
.join("");
let filter_html = ` return `
<div class="is-flex gap-2 is-flex-wrap-wrap is-justify-content-flex-start is-align-items-center search-filters"> <div class="is-flex gap-2 is-flex-wrap-wrap is-justify-content-flex-start is-align-items-center search-filters">
<span class="is-size-6">Filters:</span> <span class="is-size-6">Filters:</span>
${str} ${str}
</div> </div>`;
`; }
return filter_html;
} }
/** function waitUntilSearchIndexAvailable() {
* Make the result component given a minisearch result data object and the value of the search input as queryString. // It is possible that the documenter.js script runs before the page
* To view the result object structure, refer: https://lucaong.github.io/minisearch/modules/_minisearch_.html#searchresult // has finished loading and documenterSearchIndex gets defined.
* // So we need to wait until the search index actually loads before setting
* @param {object} result // up all the search-related stuff.
* @param {string} querystring if (
* @returns string typeof documenterSearchIndex !== "undefined" &&
*/ typeof $ !== "undefined"
function make_search_result(result, querystring) { ) {
let search_divider = `<div class="search-divider w-100"></div>`; runSearchMainCode();
let display_link = } else {
result.location.slice(Math.max(0), Math.min(50, result.location.length)) + console.warn("Search Index or jQuery not available, waiting");
(result.location.length > 30 ? "..." : ""); // To cut-off the link because it messes with the overflow of the whole div setTimeout(waitUntilSearchIndexAvailable, 100);
}
if (result.page !== "") {
display_link += ` (${result.page})`;
} }
let textindex = new RegExp(`\\b${querystring}\\b`, "i").exec(result.text); // The actual entry point to the search code
let text = waitUntilSearchIndexAvailable();
textindex !== null
? result.text.slice(
Math.max(textindex.index - 100, 0),
Math.min(
textindex.index + querystring.length + 100,
result.text.length
)
)
: ""; // cut-off text before and after from the match
let display_result = text.length
? "..." +
text.replace(
new RegExp(`\\b${querystring}\\b`, "i"), // For first occurrence
'<span class="search-result-highlight p-1">$&</span>'
) +
"..."
: ""; // highlights the match
let in_code = false;
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 = `
<a href="${encodeURI(
documenterBaseURL + "/" + result.location
)}" class="search-result-link w-100 is-flex is-flex-direction-column gap-2 px-4 py-2">
<div class="w-100 is-flex is-flex-wrap-wrap is-justify-content-space-between is-align-items-flex-start">
<div class="search-result-title has-text-weight-bold ${
in_code ? "search-result-code-title" : ""
}">${result.title}</div>
<div class="property-search-result-badge">${result.category}</div>
</div>
<p>
${display_result}
</p>
<div
class="has-text-left"
style="font-size: smaller;"
title="${result.location}"
>
<i class="fas fa-link"></i> ${display_link}
</div>
</a>
${search_divider}
`;
return result_div;
}
/**
* Get selected filters, remake the filter html and lastly update the search modal
*/
function get_filters() {
let ele = $(".search-filters .search-filter-selected").get();
filter_results = ele.map((x) => $(x).text().toLowerCase());
modal_filters = make_modal_body_filters(filters, filter_results);
update_search(filter_results);
}
}) })
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@@ -635,13 +903,15 @@ $(document).ready(function () {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
require(['jquery'], function($) { require(['jquery'], function($) {
$(document).ready(function () {
let search_modal_header = ` let search_modal_header = `
<header class="modal-card-head gap-2 is-align-items-center is-justify-content-space-between w-100 px-3"> <header class="modal-card-head gap-2 is-align-items-center is-justify-content-space-between w-100 px-3">
<div class="field mb-0 w-100"> <div class="field mb-0 w-100">
<p class="control has-icons-right"> <p class="control has-icons-right">
<input class="input documenter-search-input" type="text" placeholder="Search" /> <input class="input documenter-search-input" type="text" placeholder="Search" />
<span class="icon is-small is-right has-text-primary-dark"> <span class="icon is-small is-right has-text-primary-dark gap-2">
<i class="fas fa-magnifying-glass"></i> <i class="fas fa-link link-icon is-clickable"></i>
<i class="fas fa-magnifying-glass mr-4"></i>
</span> </span>
</p> </p>
</div> </div>
@@ -656,12 +926,21 @@ let initial_search_body = `
`; `;
let search_modal_footer = ` let search_modal_footer = `
<footer class="modal-card-foot"> <footer class="modal-card-foot is-flex is-justify-content-space-between is-align-items-center">
<div class="is-flex gap-3 is-flex-wrap-wrap">
<span> <span>
<kbd class="search-modal-key-hints">Ctrl</kbd> + <kbd class="search-modal-key-hints">Ctrl</kbd> +
<kbd class="search-modal-key-hints">/</kbd> to search <kbd class="search-modal-key-hints">/</kbd> to search
</span> </span>
<span class="ml-3"> <kbd class="search-modal-key-hints">esc</kbd> to close </span> <span> <kbd class="search-modal-key-hints">esc</kbd> to close </span>
</div>
<div class="is-flex gap-3 is-flex-wrap-wrap">
<span>
<kbd class="search-modal-key-hints">↑</kbd>
<kbd class="search-modal-key-hints">↓</kbd> to navigate
</span>
<span> <kbd class="search-modal-key-hints">Enter</kbd> to select </span>
</div>
</footer> </footer>
`; `;
@@ -677,14 +956,29 @@ $(document.body).append(
${search_modal_footer} ${search_modal_footer}
</div> </div>
</div> </div>
` `,
); );
function checkURLForSearch() {
const urlParams = new URLSearchParams(window.location.search);
const searchQuery = urlParams.get("q");
if (searchQuery) {
//only if there is a search query, open the modal
openModal();
}
}
//this function will be called whenever the page will load
checkURLForSearch();
document.querySelector(".docs-search-query").addEventListener("click", () => { document.querySelector(".docs-search-query").addEventListener("click", () => {
openModal(); openModal();
}); });
document.querySelector(".close-search-modal").addEventListener("click", () => { document
.querySelector(".close-search-modal")
.addEventListener("click", () => {
closeModal(); closeModal();
}); });
@@ -697,9 +991,52 @@ document.addEventListener("keydown", (event) => {
openModal(); openModal();
} else if (event.key === "Escape") { } else if (event.key === "Escape") {
closeModal(); closeModal();
} } else if (
document.querySelector("#search-modal")?.classList.contains("is-active")
) {
const searchResults = document.querySelectorAll(".search-result-link");
return false; if (event.key === "ArrowDown") {
event.preventDefault();
if (searchResults.length > 0) {
const currentFocused = document.activeElement;
const currentIndex =
Array.from(searchResults).indexOf(currentFocused);
const nextIndex =
currentIndex < searchResults.length - 1 ? currentIndex + 1 : 0;
searchResults[nextIndex].focus();
}
} else if (event.key === "ArrowUp") {
event.preventDefault();
if (searchResults.length > 0) {
const currentFocused = document.activeElement;
const currentIndex =
Array.from(searchResults).indexOf(currentFocused);
const prevIndex =
currentIndex > 0 ? currentIndex - 1 : searchResults.length - 1;
searchResults[prevIndex].focus();
}
}
}
});
//event listener for the link icon to copy the URL
$(document).on("click", ".link-icon", function () {
const currentUrl = window.location.href;
navigator.clipboard
.writeText(currentUrl)
.then(() => {
const $linkIcon = $(this);
$linkIcon.removeClass("fa-link").addClass("fa-check");
setTimeout(() => {
$linkIcon.removeClass("fa-check").addClass("fa-link");
}, 1000);
})
.catch((err) => {
console.error("Failed to copy URL: ", err);
});
}); });
// Functions to open and close a modal // Functions to open and close a modal
@@ -716,15 +1053,17 @@ function closeModal() {
<div class="has-text-centered my-5 py-5">Type something to get started!</div> <div class="has-text-centered my-5 py-5">Type something to get started!</div>
`; `;
$(".documenter-search-input").val("");
$(".search-modal-card-body").html(initial_search_body);
document.dispatchEvent(new CustomEvent("reset-filter"));
searchModal.classList.remove("is-active"); searchModal.classList.remove("is-active");
document.querySelector(".documenter-search-input").blur(); document.querySelector(".documenter-search-input").blur();
if (!$(".search-modal-card-body").hasClass("is-justify-content-center")) { if (!$(".search-modal-card-body").hasClass("is-justify-content-center")) {
$(".search-modal-card-body").addClass("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);
} }
document document
@@ -732,6 +1071,7 @@ document
.addEventListener("click", () => { .addEventListener("click", () => {
closeModal(); closeModal();
}); });
});
}) })
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@@ -852,7 +1192,7 @@ $(document).ready(function () {
var option = $( var option = $(
"<option value='#' selected='selected'>" + "<option value='#' selected='selected'>" +
DOCUMENTER_CURRENT_VERSION + DOCUMENTER_CURRENT_VERSION +
"</option>" "</option>",
); );
version_selector_select.append(option); version_selector_select.append(option);
} }
@@ -869,7 +1209,7 @@ $(document).ready(function () {
// otherwise update the old option with the URL and enable it // otherwise update the old option with the URL and enable it
if (existing_id == -1) { if (existing_id == -1) {
var option = $( var option = $(
"<option value='" + version_url + "'>" + each + "</option>" "<option value='" + version_url + "'>" + each + "</option>",
); );
version_selector_select.append(option); version_selector_select.append(option);
} else { } else {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
function maybeAddWarning() { function maybeAddWarning() {
// DOCUMENTER_NEWEST is defined in versions.js, DOCUMENTER_CURRENT_VERSION and DOCUMENTER_STABLE // DOCUMENTER_NEWEST is defined in versions.js, DOCUMENTER_CURRENT_VERSION and DOCUMENTER_STABLE
// in siteinfo.js. // in siteinfo.js. DOCUMENTER_IS_DEV_VERSION is optional and defined in siteinfo.js.
// If either of these are undefined something went horribly wrong, so we abort. // If the required variables are undefined something went horribly wrong, so we abort.
if ( if (
window.DOCUMENTER_NEWEST === undefined || window.DOCUMENTER_NEWEST === undefined ||
window.DOCUMENTER_CURRENT_VERSION === undefined || window.DOCUMENTER_CURRENT_VERSION === undefined ||
@@ -30,17 +30,33 @@ function maybeAddWarning() {
} }
const div = document.createElement("div"); const div = document.createElement("div");
div.classList.add("outdated-warning-overlay"); // Base class is added by default
div.classList.add("warning-overlay-base");
const closer = document.createElement("button"); const closer = document.createElement("button");
closer.classList.add("outdated-warning-closer", "delete"); closer.classList.add("outdated-warning-closer", "delete");
closer.addEventListener("click", function () { closer.addEventListener("click", function () {
document.body.removeChild(div); 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.<br><a href="' + // Determine if this is a development version or an older release
let warningMessage = "";
if (window.DOCUMENTER_IS_DEV_VERSION === true) {
div.classList.add("dev-warning-overlay");
warningMessage =
"This documentation is for the <strong>development version</strong> and may contain unstable or unreleased features.<br>";
} else {
div.classList.add("outdated-warning-overlay");
warningMessage =
"This documentation is for an <strong>older version</strong> that may be missing recent changes.<br>";
}
warningMessage +=
'<a href="' +
href + href +
'">Click here to go to the documentation for the latest stable release.</a>'; '">Click here to go to the documentation for the latest stable release.</a>';
div.innerHTML = warningMessage;
div.appendChild(closer); div.appendChild(closer);
document.body.appendChild(div); document.body.appendChild(div);
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
0.4/objects.inv Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3,40 +3,40 @@
"g1": [ "g1": [
181.92024301829747, 181.92024301829747,
172.8503730182975, 172.8503730182975,
166.8067830182975, 166.80678301829755,
163.2384530182975, 163.23845301829746,
165.5149530182975, 165.5149530182975,
169.95052301829747, 169.95052301829747,
182.3719130182975, 182.3719130182975,
191.43277301829744, 191.4327730182975,
196.67234301829745, 196.6723430182975,
202.53524301829742, 202.53524301829748,
200.33101301829748, 200.33101301829748,
201.4963530182975, 201.4963530182975,
193.55569301829746, 193.55569301829752,
191.4869630182975, 191.4869630182975,
190.44809301829747, 190.44809301829747,
194.39583301829748, 194.39583301829748,
215.15536301829752, 215.15536301829752,
239.7813630182975, 239.7813630182975,
232.7169930182975, 232.7169930182975,
237.45065301829743, 237.4506530182975,
236.98991301829744, 236.98991301829744,
223.7916330182975, 223.7916330182975,
209.51833301829748, 209.51833301829754,
192.3993830182975, 192.3993830182975,
180.73681301829748, 180.73681301829748,
172.16378301829752, 172.16378301829752,
162.23570301829744, 162.23570301829744,
165.0181030182975, 165.0181030182975,
167.24040301829746, 167.2404030182975,
180.89039301829752, 180.89039301829752,
196.95238301829744, 196.9523830182975,
206.5552530182975, 206.5552530182975,
214.18877301829747, 214.18877301829752,
225.48092301829746, 225.48092301829752,
226.81792301829745, 226.8179230182975,
222.7256530182974 222.72565301829746
], ],
"g2": [ "g2": [
0.0, 0.0,
@@ -193,42 +193,42 @@
}, },
"Thermal production cost ($)": { "Thermal production cost ($)": {
"g1": [ "g1": [
7241.945066727594, 7241.945066727592,
6839.01359409579, 6839.01359409579,
6570.525443914714, 6570.525443914716,
6412.001400931049, 6412.001400931047,
6513.13554038909, 6513.135540389088,
6710.186959214436, 6710.186959214436,
7262.010630869485, 7262.010630869485,
7669.483607423414, 7669.483607423414,
7905.5011921482255, 7905.5011921482255,
8169.596814018547, 8169.596814018549,
8070.306788161854, 8070.306788161854,
8122.799785141226, 8122.799785141226,
7765.111006420659, 7765.1110064206605,
7671.924607909377, 7671.924607909377,
7625.1284799364585, 7625.1284799364585,
7802.955297771037, 7802.955297771037,
8738.072899143339, 8738.072899143339,
9847.356493299576, 9847.356493299576,
9529.140390641836, 9529.140390641836,
9742.36914798422, 9742.369147984222,
9721.615013201, 9721.615013201,
9127.095583529908, 9127.095583529908,
8484.151641173446, 8484.151641173448,
7713.024767780247, 7713.024767780247,
7189.370863055805, 7189.370863055803,
6808.5116442559065, 6808.5116442559065,
6367.453956019317, 6367.453956019317,
6491.062842304429, 6491.062842304429,
6589.789131835552, 6589.789131835554,
7196.193696852408, 7196.193696852408,
7918.115655630216, 7918.115655630216,
8350.679049921417, 8350.679049921417,
8694.53263969091, 8694.532639690911,
9203.19002366522, 9203.19002366522,
9263.415483154657, 9263.415483154658,
9079.078279635702 9079.078279635703
], ],
"g2": [ "g2": [
0.0, 0.0,
@@ -1725,6 +1725,17 @@
0.0 0.0
], ],
"b2": [ "b2": [
0.0,
-0.0,
-0.0,
0.0,
0.0,
-0.0,
-0.0,
0.0,
-0.0,
0.0,
0.0,
-0.0, -0.0,
-0.0, -0.0,
-0.0, -0.0,
@@ -1733,34 +1744,23 @@
-0.0, -0.0,
-0.0, -0.0,
-0.0, -0.0,
0.0,
-0.0, -0.0,
-0.0, -0.0,
-0.0, -0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
-0.0,
0.0,
-0.0, -0.0,
-0.0, -0.0,
-0.0, -0.0,
-0.0, 0.0
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0
], ],
"b3": [ "b3": [
0.0, 0.0,
@@ -1802,28 +1802,6 @@
], ],
"b4": [ "b4": [
0.0, 0.0,
-0.0,
-0.0,
0.0,
0.0,
-0.0,
-0.0,
0.0,
-0.0,
0.0,
0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
0.0,
-0.0,
-0.0,
-0.0,
0.0, 0.0,
0.0, 0.0,
0.0, 0.0,
@@ -1831,11 +1809,33 @@
0.0, 0.0,
0.0, 0.0,
0.0, 0.0,
-0.0,
0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0 0.0
], ],
"b5": [ "b5": [
@@ -1877,42 +1877,42 @@
0.0 0.0
], ],
"b6": [ "b6": [
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0, 0.0,
-0.0 0.0
], ],
"b7": [ "b7": [
0.0, 0.0,
@@ -2985,39 +2985,39 @@
"r1": { "r1": {
"g1": [ "g1": [
4.61, 4.61,
4.43,
0.0, 0.0,
4.31,
4.24, 4.24,
4.29,
0.0, 0.0,
0.0, 0.0,
0.0, 0.0,
0.0, 0.0,
0.0, 0.0,
4.98,
0.0, 0.0,
0.0, 4.85,
0.0,
0.0,
4.81, 4.81,
4.79, 4.79,
4.86, 4.86,
0.0, 5.28,
5.77, 5.77,
5.63, 5.63,
5.73, 5.73,
5.72,
0.0, 0.0,
0.0, 0.0,
5.17, 4.82,
0.0,
0.0, 0.0,
4.59,
4.42,
0.0, 0.0,
4.28, 4.28,
4.32,
4.59,
4.92,
0.0, 0.0,
0.0, 0.0,
5.49, 0.0,
5.11,
0.0,
0.0,
5.51, 5.51,
0.0 0.0
], ],
@@ -3060,40 +3060,40 @@
0.0 0.0
], ],
"g3": [ "g3": [
0.0,
4.43,
0.0, 0.0,
0.0, 0.0,
4.31,
0.0, 0.0,
4.29,
4.38, 4.38,
4.62, 4.62,
4.81, 4.81,
4.91, 4.91,
5.03, 5.03,
4.98, 0.0,
5.01, 5.01,
4.85,
0.0, 0.0,
0.0, 0.0,
0.0, 0.0,
5.28,
0.0, 0.0,
0.0, 0.0,
0.0, 0.0,
5.72, 0.0,
0.0,
0.0,
5.45, 5.45,
5.17,
0.0, 0.0,
4.82, 4.59,
0.0, 4.42,
0.0,
4.22, 4.22,
0.0, 0.0,
4.32,
4.59,
4.92,
0.0, 0.0,
0.0,
0.0,
5.11,
5.26, 5.26,
0.0, 5.49,
0.0, 0.0,
5.43 5.43
], ],

File diff suppressed because one or more lines are too long