[main]: Update mkdocs to zensical
This commit is contained in:
100 files changed
+2605
-221
No files matched your search
+85
-25
@@ -1,27 +1,87 @@
|
||||
window.MathJax = {
|
||||
tex: {
|
||||
inlineMath: [["\\(", "\\)"]],
|
||||
displayMath: [["\\[", "\\]"]],
|
||||
processEscapes: true,
|
||||
processEnvironments: true
|
||||
},
|
||||
options: {
|
||||
ignoreHtmlClass: ".*|",
|
||||
processHtmlClass: "arithmatex"
|
||||
},
|
||||
startup: {
|
||||
typeset: false,
|
||||
ready() {
|
||||
MathJax.startup.defaultReady();
|
||||
// Subscribe only after MathJax is ready, including on instant navigation.
|
||||
MathJax.startup.promise.then(() => {
|
||||
document$.subscribe(() => {
|
||||
MathJax.startup.output.clearCache();
|
||||
MathJax.typesetClear();
|
||||
MathJax.texReset();
|
||||
MathJax.typesetPromise();
|
||||
});
|
||||
});
|
||||
(() => {
|
||||
const rendererUrl = new URL(
|
||||
"../assets/vendor/mathjax/tex-mml-chtml.js",
|
||||
document.currentScript.src
|
||||
);
|
||||
const assetRoot = new URL(".", rendererUrl).href.replace(/\/$/, "");
|
||||
let loading;
|
||||
let revision = 0;
|
||||
let rendering = Promise.resolve();
|
||||
|
||||
function loadMathJax() {
|
||||
if (loading) {
|
||||
return loading;
|
||||
}
|
||||
|
||||
window.MathJax = {
|
||||
loader: {
|
||||
paths: {
|
||||
mathjax: assetRoot,
|
||||
sre: `${assetRoot}/sre/mathmaps`
|
||||
}
|
||||
},
|
||||
tex: {
|
||||
inlineMath: [["\\(", "\\)"]],
|
||||
displayMath: [["\\[", "\\]"]],
|
||||
processEscapes: true,
|
||||
processEnvironments: true
|
||||
},
|
||||
options: {
|
||||
ignoreHtmlClass: ".*|",
|
||||
processHtmlClass: "arithmatex"
|
||||
},
|
||||
chtml: {
|
||||
fontURL: `${assetRoot}/output/chtml/fonts/woff-v2`
|
||||
},
|
||||
startup: {
|
||||
typeset: false
|
||||
}
|
||||
};
|
||||
|
||||
loading = new Promise((resolve, reject) => {
|
||||
const script = document.createElement("script");
|
||||
script.src = rendererUrl.href;
|
||||
script.async = true;
|
||||
script.onload = () => {
|
||||
window.MathJax.startup.promise.then(() => resolve(window.MathJax), reject);
|
||||
};
|
||||
script.onerror = () => {
|
||||
loading = undefined;
|
||||
script.remove();
|
||||
reject(new Error(`Failed to load MathJax from ${rendererUrl.href}`));
|
||||
};
|
||||
document.head.append(script);
|
||||
});
|
||||
return loading;
|
||||
}
|
||||
};
|
||||
|
||||
document$.subscribe(() => {
|
||||
const currentRevision = ++revision;
|
||||
|
||||
// Serialize rendering and discard navigation events superseded during loading.
|
||||
rendering = rendering.then(async () => {
|
||||
if (currentRevision !== revision) {
|
||||
return;
|
||||
}
|
||||
const content = document.querySelector(".md-content");
|
||||
if (!content || !content.querySelector(".arithmatex")) {
|
||||
if (loading) {
|
||||
const mathjax = await loading;
|
||||
mathjax.typesetClear();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const mathjax = await loadMathJax();
|
||||
if (currentRevision !== revision) {
|
||||
return;
|
||||
}
|
||||
mathjax.startup.output.clearCache();
|
||||
mathjax.typesetClear();
|
||||
mathjax.texReset();
|
||||
await mathjax.typesetPromise([content]);
|
||||
}).catch(error => {
|
||||
console.error("Jupiter Notes: unable to render mathematics.", error);
|
||||
});
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user