Skip to content

Commit 14e8038

Browse files
Deployed 85996e1 with MkDocs version: 1.6.1
0 parents  commit 14e8038

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+12899
-0
lines changed

.nojekyll

Whitespace-only changes.

404.html

+633
Large diffs are not rendered by default.

assets/_markdown_exec_pyodide.css

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
html[data-theme="light"] {
2+
@import "https://cdn.jsdelivr.net/npm/[email protected]/tomorrow.css"
3+
}
4+
5+
html[data-theme="dark"] {
6+
@import "https://cdn.jsdelivr.net/npm/[email protected]/tomorrow-night-blue.min.css"
7+
}
8+
9+
10+
.ace_gutter {
11+
z-index: 1;
12+
}
13+
14+
.pyodide-editor {
15+
width: 100%;
16+
min-height: 200px;
17+
max-height: 400px;
18+
font-size: .85em;
19+
}
20+
21+
.pyodide-editor-bar {
22+
color: var(--md-primary-bg-color);
23+
background-color: var(--md-primary-fg-color);
24+
width: 100%;
25+
font: monospace;
26+
font-size: 0.75em;
27+
padding: 2px 0 2px;
28+
}
29+
30+
.pyodide-bar-item {
31+
padding: 0 18px 0;
32+
display: inline-block;
33+
width: 50%;
34+
}
35+
36+
.pyodide pre {
37+
margin: 0;
38+
}
39+
40+
.pyodide-output {
41+
width: 100%;
42+
margin-bottom: -15px;
43+
min-height: 46px;
44+
max-height: 400px
45+
}
46+
47+
.pyodide-clickable {
48+
cursor: pointer;
49+
text-align: right;
50+
}

assets/_markdown_exec_pyodide.js

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
var _sessions = {};
2+
3+
function getSession(name, pyodide) {
4+
if (!(name in _sessions)) {
5+
_sessions[name] = pyodide.globals.get("dict")();
6+
}
7+
return _sessions[name];
8+
}
9+
10+
function writeOutput(element, string) {
11+
element.innerHTML += string + '\n';
12+
}
13+
14+
function clearOutput(element) {
15+
element.innerHTML = '';
16+
}
17+
18+
async function evaluatePython(pyodide, editor, output, session) {
19+
pyodide.setStdout({ batched: (string) => { writeOutput(output, string); } });
20+
let result, code = editor.getValue();
21+
clearOutput(output);
22+
try {
23+
result = await pyodide.runPythonAsync(code, { globals: getSession(session, pyodide) });
24+
} catch (error) {
25+
writeOutput(output, error);
26+
}
27+
if (result) writeOutput(output, result);
28+
hljs.highlightElement(output);
29+
}
30+
31+
async function initPyodide() {
32+
try {
33+
let pyodide = await loadPyodide();
34+
await pyodide.loadPackage("micropip");
35+
return pyodide;
36+
} catch(error) {
37+
return null;
38+
}
39+
}
40+
41+
function getTheme() {
42+
return document.body.getAttribute('data-md-color-scheme');
43+
}
44+
45+
function setTheme(editor, currentTheme, light, dark) {
46+
// https://gist.github.com/RyanNutt/cb8d60997d97905f0b2aea6c3b5c8ee0
47+
if (currentTheme === "default") {
48+
editor.setTheme("ace/theme/" + light);
49+
document.querySelector(`link[title="light"]`).removeAttribute("disabled");
50+
document.querySelector(`link[title="dark"]`).setAttribute("disabled", "disabled");
51+
} else if (currentTheme === "slate") {
52+
editor.setTheme("ace/theme/" + dark);
53+
document.querySelector(`link[title="dark"]`).removeAttribute("disabled");
54+
document.querySelector(`link[title="light"]`).setAttribute("disabled", "disabled");
55+
}
56+
}
57+
58+
function updateTheme(editor, light, dark) {
59+
// Create a new MutationObserver instance
60+
const observer = new MutationObserver((mutations) => {
61+
// Loop through the mutations that occurred
62+
mutations.forEach((mutation) => {
63+
// Check if the mutation was a change to the data-md-color-scheme attribute
64+
if (mutation.attributeName === 'data-md-color-scheme') {
65+
// Get the new value of the attribute
66+
const newColorScheme = mutation.target.getAttribute('data-md-color-scheme');
67+
// Update the editor theme
68+
setTheme(editor, newColorScheme, light, dark);
69+
}
70+
});
71+
});
72+
73+
// Configure the observer to watch for changes to the data-md-color-scheme attribute
74+
observer.observe(document.body, {
75+
attributes: true,
76+
attributeFilter: ['data-md-color-scheme'],
77+
});
78+
}
79+
80+
async function setupPyodide(idPrefix, install = null, themeLight = 'tomorrow', themeDark = 'tomorrow_night', session = null) {
81+
const editor = ace.edit(idPrefix + "editor");
82+
const run = document.getElementById(idPrefix + "run");
83+
const clear = document.getElementById(idPrefix + "clear");
84+
const output = document.getElementById(idPrefix + "output");
85+
86+
updateTheme(editor, themeLight, themeDark);
87+
88+
editor.session.setMode("ace/mode/python");
89+
setTheme(editor, getTheme(), themeLight, themeDark);
90+
91+
writeOutput(output, "Initializing...");
92+
let pyodide = await pyodidePromise;
93+
if (install && install.length) {
94+
micropip = pyodide.pyimport("micropip");
95+
for (const package of install)
96+
await micropip.install(package);
97+
}
98+
clearOutput(output);
99+
run.onclick = () => evaluatePython(pyodide, editor, output, session);
100+
clear.onclick = () => clearOutput(output);
101+
output.parentElement.parentElement.addEventListener("keydown", (event) => {
102+
if (event.ctrlKey && event.key.toLowerCase() === 'enter') {
103+
event.preventDefault();
104+
run.click();
105+
}
106+
});
107+
}
108+
109+
var pyodidePromise = initPyodide();

assets/_mkdocstrings.css

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
2+
/* Avoid breaking parameter names, etc. in table cells. */
3+
.doc-contents td code {
4+
word-break: normal !important;
5+
}
6+
7+
/* No line break before first paragraph of descriptions. */
8+
.doc-md-description,
9+
.doc-md-description>p:first-child {
10+
display: inline;
11+
}
12+
13+
/* Max width for docstring sections tables. */
14+
.doc .md-typeset__table,
15+
.doc .md-typeset__table table {
16+
display: table !important;
17+
width: 100%;
18+
}
19+
20+
.doc .md-typeset__table tr {
21+
display: table-row;
22+
}
23+
24+
/* Defaults in Spacy table style. */
25+
.doc-param-default {
26+
float: right;
27+
}
28+
29+
/* Parameter headings must be inline, not blocks. */
30+
.doc-heading-parameter {
31+
display: inline;
32+
}
33+
34+
/* Prefer space on the right, not the left of parameter permalinks. */
35+
.doc-heading-parameter .headerlink {
36+
margin-left: 0 !important;
37+
margin-right: 0.2rem;
38+
}
39+
40+
/* Backward-compatibility: docstring section titles in bold. */
41+
.doc-section-title {
42+
font-weight: bold;
43+
}
44+
45+
/* Symbols in Navigation and ToC. */
46+
:root, :host,
47+
[data-md-color-scheme="default"] {
48+
--doc-symbol-parameter-fg-color: #df50af;
49+
--doc-symbol-attribute-fg-color: #953800;
50+
--doc-symbol-function-fg-color: #8250df;
51+
--doc-symbol-method-fg-color: #8250df;
52+
--doc-symbol-class-fg-color: #0550ae;
53+
--doc-symbol-module-fg-color: #5cad0f;
54+
55+
--doc-symbol-parameter-bg-color: #df50af1a;
56+
--doc-symbol-attribute-bg-color: #9538001a;
57+
--doc-symbol-function-bg-color: #8250df1a;
58+
--doc-symbol-method-bg-color: #8250df1a;
59+
--doc-symbol-class-bg-color: #0550ae1a;
60+
--doc-symbol-module-bg-color: #5cad0f1a;
61+
}
62+
63+
[data-md-color-scheme="slate"] {
64+
--doc-symbol-parameter-fg-color: #ffa8cc;
65+
--doc-symbol-attribute-fg-color: #ffa657;
66+
--doc-symbol-function-fg-color: #d2a8ff;
67+
--doc-symbol-method-fg-color: #d2a8ff;
68+
--doc-symbol-class-fg-color: #79c0ff;
69+
--doc-symbol-module-fg-color: #baff79;
70+
71+
--doc-symbol-parameter-bg-color: #ffa8cc1a;
72+
--doc-symbol-attribute-bg-color: #ffa6571a;
73+
--doc-symbol-function-bg-color: #d2a8ff1a;
74+
--doc-symbol-method-bg-color: #d2a8ff1a;
75+
--doc-symbol-class-bg-color: #79c0ff1a;
76+
--doc-symbol-module-bg-color: #baff791a;
77+
}
78+
79+
code.doc-symbol {
80+
border-radius: .1rem;
81+
font-size: .85em;
82+
padding: 0 .3em;
83+
font-weight: bold;
84+
}
85+
86+
code.doc-symbol-parameter {
87+
color: var(--doc-symbol-parameter-fg-color);
88+
background-color: var(--doc-symbol-parameter-bg-color);
89+
}
90+
91+
code.doc-symbol-parameter::after {
92+
content: "param";
93+
}
94+
95+
code.doc-symbol-attribute {
96+
color: var(--doc-symbol-attribute-fg-color);
97+
background-color: var(--doc-symbol-attribute-bg-color);
98+
}
99+
100+
code.doc-symbol-attribute::after {
101+
content: "attr";
102+
}
103+
104+
code.doc-symbol-function {
105+
color: var(--doc-symbol-function-fg-color);
106+
background-color: var(--doc-symbol-function-bg-color);
107+
}
108+
109+
code.doc-symbol-function::after {
110+
content: "func";
111+
}
112+
113+
code.doc-symbol-method {
114+
color: var(--doc-symbol-method-fg-color);
115+
background-color: var(--doc-symbol-method-bg-color);
116+
}
117+
118+
code.doc-symbol-method::after {
119+
content: "meth";
120+
}
121+
122+
code.doc-symbol-class {
123+
color: var(--doc-symbol-class-fg-color);
124+
background-color: var(--doc-symbol-class-bg-color);
125+
}
126+
127+
code.doc-symbol-class::after {
128+
content: "class";
129+
}
130+
131+
code.doc-symbol-module {
132+
color: var(--doc-symbol-module-fg-color);
133+
background-color: var(--doc-symbol-module-bg-color);
134+
}
135+
136+
code.doc-symbol-module::after {
137+
content: "mod";
138+
}
139+
140+
.doc-signature .autorefs {
141+
color: inherit;
142+
border-bottom: 1px dotted currentcolor;
143+
}

assets/images/favicon.png

1.83 KB
Loading

assets/javascripts/bundle.88dd0f4e.min.js

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)