This commit is contained in:
Oscar Plaisant
2025-03-27 12:50:27 +01:00
parent 5368f2de3a
commit 32bdf8cfcb
33 changed files with 764 additions and 720 deletions

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,189 +0,0 @@
/* quarto syntax highlight colors */
:root {
--quarto-hl-al-color: #f07178;
--quarto-hl-an-color: #d4d0ab;
--quarto-hl-at-color: #00e0e0;
--quarto-hl-bn-color: #d4d0ab;
--quarto-hl-bu-color: #abe338;
--quarto-hl-ch-color: #abe338;
--quarto-hl-co-color: #f8f8f2;
--quarto-hl-cv-color: #ffd700;
--quarto-hl-cn-color: #ffd700;
--quarto-hl-cf-color: #ffa07a;
--quarto-hl-dt-color: #ffa07a;
--quarto-hl-dv-color: #d4d0ab;
--quarto-hl-do-color: #f8f8f2;
--quarto-hl-er-color: #f07178;
--quarto-hl-ex-color: #00e0e0;
--quarto-hl-fl-color: #d4d0ab;
--quarto-hl-fu-color: #ffa07a;
--quarto-hl-im-color: #abe338;
--quarto-hl-in-color: #d4d0ab;
--quarto-hl-kw-color: #ffa07a;
--quarto-hl-op-color: #ffa07a;
--quarto-hl-ot-color: #00e0e0;
--quarto-hl-pp-color: #dcc6e0;
--quarto-hl-re-color: #00e0e0;
--quarto-hl-sc-color: #abe338;
--quarto-hl-ss-color: #abe338;
--quarto-hl-st-color: #abe338;
--quarto-hl-va-color: #00e0e0;
--quarto-hl-vs-color: #abe338;
--quarto-hl-wa-color: #dcc6e0;
}
/* other quarto variables */
:root {
--quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
code span.al {
background-color: #2a0f15;
font-weight: bold;
color: #f07178;
}
code span.an {
color: #d4d0ab;
}
code span.at {
color: #00e0e0;
}
code span.bn {
color: #d4d0ab;
}
code span.bu {
color: #abe338;
}
code span.ch {
color: #abe338;
}
code span.co {
font-style: italic;
color: #f8f8f2;
}
code span.cv {
color: #ffd700;
}
code span.cn {
color: #ffd700;
}
code span.cf {
font-weight: bold;
color: #ffa07a;
}
code span.dt {
color: #ffa07a;
}
code span.dv {
color: #d4d0ab;
}
code span.do {
color: #f8f8f2;
}
code span.er {
color: #f07178;
text-decoration: underline;
}
code span.ex {
font-weight: bold;
color: #00e0e0;
}
code span.fl {
color: #d4d0ab;
}
code span.fu {
color: #ffa07a;
}
code span.im {
color: #abe338;
}
code span.in {
color: #d4d0ab;
}
code span.kw {
font-weight: bold;
color: #ffa07a;
}
pre > code.sourceCode > span {
color: #f8f8f2;
}
code span {
color: #f8f8f2;
}
code.sourceCode > span {
color: #f8f8f2;
}
div.sourceCode,
div.sourceCode pre.sourceCode {
color: #f8f8f2;
}
code span.op {
color: #ffa07a;
}
code span.ot {
color: #00e0e0;
}
code span.pp {
color: #dcc6e0;
}
code span.re {
background-color: #f8f8f2;
color: #00e0e0;
}
code span.sc {
color: #abe338;
}
code span.ss {
color: #abe338;
}
code span.st {
color: #abe338;
}
code span.va {
color: #00e0e0;
}
code span.vs {
color: #abe338;
}
code span.wa {
color: #dcc6e0;
}
.prevent-inlining {
content: "</";
}
/*# sourceMappingURL=935a306eefa94366c21e1a970dddb765.css.map */

View File

@@ -1,203 +0,0 @@
/* quarto syntax highlight colors */
:root {
--quarto-hl-ot-color: #003B4F;
--quarto-hl-at-color: #657422;
--quarto-hl-ss-color: #20794D;
--quarto-hl-an-color: #5E5E5E;
--quarto-hl-fu-color: #4758AB;
--quarto-hl-st-color: #20794D;
--quarto-hl-cf-color: #003B4F;
--quarto-hl-op-color: #5E5E5E;
--quarto-hl-er-color: #AD0000;
--quarto-hl-bn-color: #AD0000;
--quarto-hl-al-color: #AD0000;
--quarto-hl-va-color: #111111;
--quarto-hl-bu-color: inherit;
--quarto-hl-ex-color: inherit;
--quarto-hl-pp-color: #AD0000;
--quarto-hl-in-color: #5E5E5E;
--quarto-hl-vs-color: #20794D;
--quarto-hl-wa-color: #5E5E5E;
--quarto-hl-do-color: #5E5E5E;
--quarto-hl-im-color: #00769E;
--quarto-hl-ch-color: #20794D;
--quarto-hl-dt-color: #AD0000;
--quarto-hl-fl-color: #AD0000;
--quarto-hl-co-color: #5E5E5E;
--quarto-hl-cv-color: #5E5E5E;
--quarto-hl-cn-color: #8f5902;
--quarto-hl-sc-color: #5E5E5E;
--quarto-hl-dv-color: #AD0000;
--quarto-hl-kw-color: #003B4F;
}
/* other quarto variables */
:root {
--quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
pre > code.sourceCode > span {
color: #003B4F;
}
code span {
color: #003B4F;
}
code.sourceCode > span {
color: #003B4F;
}
div.sourceCode,
div.sourceCode pre.sourceCode {
color: #003B4F;
}
code span.ot {
color: #003B4F;
font-style: inherit;
}
code span.at {
color: #657422;
font-style: inherit;
}
code span.ss {
color: #20794D;
font-style: inherit;
}
code span.an {
color: #5E5E5E;
font-style: inherit;
}
code span.fu {
color: #4758AB;
font-style: inherit;
}
code span.st {
color: #20794D;
font-style: inherit;
}
code span.cf {
color: #003B4F;
font-style: inherit;
}
code span.op {
color: #5E5E5E;
font-style: inherit;
}
code span.er {
color: #AD0000;
font-style: inherit;
}
code span.bn {
color: #AD0000;
font-style: inherit;
}
code span.al {
color: #AD0000;
font-style: inherit;
}
code span.va {
color: #111111;
font-style: inherit;
}
code span.bu {
font-style: inherit;
}
code span.ex {
font-style: inherit;
}
code span.pp {
color: #AD0000;
font-style: inherit;
}
code span.in {
color: #5E5E5E;
font-style: inherit;
}
code span.vs {
color: #20794D;
font-style: inherit;
}
code span.wa {
color: #5E5E5E;
font-style: italic;
}
code span.do {
color: #5E5E5E;
font-style: italic;
}
code span.im {
color: #00769E;
font-style: inherit;
}
code span.ch {
color: #20794D;
font-style: inherit;
}
code span.dt {
color: #AD0000;
font-style: inherit;
}
code span.fl {
color: #AD0000;
font-style: inherit;
}
code span.co {
color: #5E5E5E;
font-style: inherit;
}
code span.cv {
color: #5E5E5E;
font-style: italic;
}
code span.cn {
color: #8f5902;
font-style: inherit;
}
code span.sc {
color: #5E5E5E;
font-style: inherit;
}
code span.dv {
color: #AD0000;
font-style: inherit;
}
code span.kw {
color: #003B4F;
font-style: inherit;
}
.prevent-inlining {
content: "</";
}
/*# sourceMappingURL=debc5d5d77c3f9108843748ff7464032.css.map */

View File

@@ -94,7 +94,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
if (link.href.indexOf("#") !== -1) {
const anchor = link.href.split("#")[1];
const heading = window.document.querySelector(
`[data-anchor-id=${anchor}]`
`[data-anchor-id="${anchor}"]`
);
if (heading) {
// Add the class
@@ -134,8 +134,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
window.innerHeight + window.pageYOffset >=
window.document.body.offsetHeight
) {
// This is the no-scroll case where last section should be the active one
sectionIndex = 0;
} else {
// This finds the last section visible on screen that should be made active
sectionIndex = [...sections].reverse().findIndex((section) => {
if (section) {
return window.pageYOffset >= section.offsetTop - sectionMargin;
@@ -223,7 +225,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
}
async function findAndActivateCategories() {
const currentPagePath = offsetAbsoluteUrl(window.location.href);
// Categories search with listing only use path without query
const currentPagePath = offsetAbsoluteUrl(
window.location.origin + window.location.pathname
);
const response = await fetch(offsetRelativeUrl("listings.json"));
if (response.status == 200) {
return response.json().then(function (listingPaths) {
@@ -317,6 +322,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
for (const child of el.children) {
child.style.opacity = 0;
child.style.overflow = "hidden";
child.style.pointerEvents = "none";
}
nexttick(() => {
@@ -358,6 +364,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
const clone = child.cloneNode(true);
clone.style.opacity = 1;
clone.style.pointerEvents = null;
clone.style.display = null;
toggleContents.append(clone);
}
@@ -432,6 +439,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
for (const child of el.children) {
child.style.opacity = 1;
child.style.overflow = null;
child.style.pointerEvents = null;
}
const placeholderEl = window.document.getElementById(
@@ -739,6 +747,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
// Process the collapse state if this is an UL
if (el.tagName === "UL") {
if (tocOpenDepth === -1 && depth > 1) {
// toc-expand: false
el.classList.add("collapse");
} else if (
depth <= tocOpenDepth ||
@@ -757,10 +766,9 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
};
// walk the TOC and expand / collapse any items that should be shown
if (tocEl) {
walk(tocEl, 0);
updateActiveLink();
walk(tocEl, 0);
}
// Throttle the scroll event and walk peridiocally
@@ -779,6 +787,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
window.addEventListener(
"resize",
throttle(() => {
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
if (!isReaderMode()) {
hideOverlappedSidebars();
}

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,8 @@ const kProgressiveAttr = "data-src";
let categoriesLoaded = false;
window.quartoListingCategory = (category) => {
// category is URI encoded in EJS template for UTF-8 support
category = decodeURIComponent(atob(category));
if (categoriesLoaded) {
activateCategory(category);
setCategoryHash(category);
@@ -15,7 +17,9 @@ window["quarto-listing-loaded"] = () => {
if (hash) {
// If there is a category, switch to that
if (hash.category) {
activateCategory(hash.category);
// category hash are URI encoded so we need to decode it before processing
// so that we can match it with the category element processed in JS
activateCategory(decodeURIComponent(hash.category));
}
// Paginate a specific listing
const listingIds = Object.keys(window["quarto-listings"]);
@@ -58,7 +62,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
);
for (const categoryEl of categoryEls) {
const category = categoryEl.getAttribute("data-category");
// category needs to support non ASCII characters
const category = decodeURIComponent(
atob(categoryEl.getAttribute("data-category"))
);
categoryEl.onclick = () => {
activateCategory(category);
setCategoryHash(category);
@@ -208,7 +215,9 @@ function activateCategory(category) {
// Activate this category
const categoryEl = window.document.querySelector(
`.quarto-listing-category .category[data-category='${category}'`
`.quarto-listing-category .category[data-category='${btoa(
encodeURIComponent(category)
)}']`
);
if (categoryEl) {
categoryEl.classList.add("active");
@@ -231,7 +240,9 @@ function filterListingCategory(category) {
list.filter(function (item) {
const itemValues = item.values();
if (itemValues.categories !== null) {
const categories = itemValues.categories.split(",");
const categories = decodeURIComponent(
atob(itemValues.categories)
).split(",");
return categories.includes(category);
} else {
return false;

View File

@@ -5,9 +5,45 @@ const headroomChanged = new CustomEvent("quarto-hrChanged", {
composed: false,
});
const announceDismiss = () => {
const annEl = window.document.getElementById("quarto-announcement");
if (annEl) {
annEl.remove();
const annId = annEl.getAttribute("data-announcement-id");
window.localStorage.setItem(`quarto-announce-${annId}`, "true");
}
};
const announceRegister = () => {
const annEl = window.document.getElementById("quarto-announcement");
if (annEl) {
const annId = annEl.getAttribute("data-announcement-id");
const isDismissed =
window.localStorage.getItem(`quarto-announce-${annId}`) || false;
if (isDismissed) {
announceDismiss();
return;
} else {
annEl.classList.remove("hidden");
}
const actionEl = annEl.querySelector(".quarto-announcement-action");
if (actionEl) {
actionEl.addEventListener("click", function (e) {
e.preventDefault();
// Hide the bar immediately
announceDismiss();
});
}
}
};
window.document.addEventListener("DOMContentLoaded", function () {
let init = false;
announceRegister();
// Manage the back to top button, if one is present.
let lastScrollTop = window.pageYOffset || document.documentElement.scrollTop;
const scrollDownBuffer = 5;

View File

@@ -1275,7 +1275,11 @@ async function fuseSearch(query, fuse, fuseOptions) {
// If we don't have a subfuse and the query is long enough, go ahead
// and create a subfuse to use for subsequent queries
if (now - then > kFuseMaxWait && subSearchFuse === undefined) {
if (
now - then > kFuseMaxWait &&
subSearchFuse === undefined &&
resultsRaw.length < fuseOptions.limit
) {
subSearchTerm = query;
subSearchFuse = new window.Fuse([], kFuseIndexOptions);
resultsRaw.forEach((rr) => {