Skip to content

Commit 63067fb

Browse files
Deployed 5826fb6 with MkDocs version: 1.6.1
0 parents  commit 63067fb

Some content is hidden

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

56 files changed

+12219
-0
lines changed

.nojekyll

Whitespace-only changes.

404.html

Lines changed: 551 additions & 0 deletions
Large diffs are not rendered by default.

assets/_markdown_exec_pyodide.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
font-size: .85em;
17+
}
18+
19+
.pyodide-editor-bar {
20+
color: var(--md-primary-bg-color);
21+
background-color: var(--md-primary-fg-color);
22+
width: 100%;
23+
font: monospace;
24+
font-size: 0.75em;
25+
padding: 2px 0 2px;
26+
}
27+
28+
.pyodide-bar-item {
29+
padding: 0 18px 0;
30+
display: inline-block;
31+
width: 50%;
32+
}
33+
34+
.pyodide pre {
35+
margin: 0;
36+
}
37+
38+
.pyodide-output {
39+
width: 100%;
40+
margin-bottom: -15px;
41+
min-height: 46px;
42+
max-height: 400px
43+
}
44+
45+
.pyodide-clickable {
46+
cursor: pointer;
47+
text-align: right;
48+
}
49+
50+
/* For themes other than Material. */
51+
.pyodide .twemoji svg {
52+
width: 1rem;
53+
}

assets/_markdown_exec_pyodide.js

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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, new Option(string).innerHTML); } });
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, new Option(error.toString()).innerHTML);
26+
}
27+
if (result) writeOutput(output, new Option(result).innerHTML);
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(
81+
idPrefix,
82+
install = null,
83+
themeLight = 'tomorrow',
84+
themeDark = 'tomorrow_night',
85+
session = null,
86+
minLines = 5,
87+
maxLines = 30,
88+
) {
89+
const editor = ace.edit(idPrefix + "editor");
90+
const run = document.getElementById(idPrefix + "run");
91+
const clear = document.getElementById(idPrefix + "clear");
92+
const output = document.getElementById(idPrefix + "output");
93+
94+
updateTheme(editor, themeLight, themeDark);
95+
96+
editor.session.setMode("ace/mode/python");
97+
setTheme(editor, getTheme(), themeLight, themeDark);
98+
99+
editor.setOption("minLines", minLines);
100+
editor.setOption("maxLines", maxLines);
101+
102+
// Force editor to resize after setting options
103+
editor.resize();
104+
105+
writeOutput(output, "Initializing...");
106+
let pyodide = await pyodidePromise;
107+
if (install && install.length) {
108+
try {
109+
micropip = pyodide.pyimport("micropip");
110+
for (const package of install)
111+
await micropip.install(package);
112+
clearOutput(output);
113+
} catch (error) {
114+
clearOutput(output);
115+
writeOutput(output, `Could not install one or more packages: ${install.join(", ")}\n`);
116+
writeOutput(output, new Option(error.toString()).innerHTML);
117+
}
118+
} else {
119+
clearOutput(output);
120+
}
121+
run.onclick = () => evaluatePython(pyodide, editor, output, session);
122+
clear.onclick = () => clearOutput(output);
123+
output.parentElement.parentElement.addEventListener("keydown", (event) => {
124+
if (event.ctrlKey && event.key.toLowerCase() === 'enter') {
125+
event.preventDefault();
126+
run.click();
127+
}
128+
});
129+
}
130+
131+
var pyodidePromise = initPyodide();

assets/_mkdocstrings.css

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
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+
/* No text transformation from Material for MkDocs for H5 headings. */
14+
.md-typeset h5 .doc-object-name {
15+
text-transform: none;
16+
}
17+
18+
/* Max width for docstring sections tables. */
19+
.doc .md-typeset__table,
20+
.doc .md-typeset__table table {
21+
display: table !important;
22+
width: 100%;
23+
}
24+
25+
.doc .md-typeset__table tr {
26+
display: table-row;
27+
}
28+
29+
/* Defaults in Spacy table style. */
30+
.doc-param-default,
31+
.doc-type_param-default {
32+
float: right;
33+
}
34+
35+
/* Parameter headings must be inline, not blocks. */
36+
.doc-heading-parameter,
37+
.doc-heading-type_parameter {
38+
display: inline;
39+
}
40+
41+
/* Default font size for parameter headings. */
42+
.md-typeset .doc-heading-parameter {
43+
font-size: inherit;
44+
}
45+
46+
/* Prefer space on the right, not the left of parameter permalinks. */
47+
.doc-heading-parameter .headerlink,
48+
.doc-heading-type_parameter .headerlink {
49+
margin-left: 0 !important;
50+
margin-right: 0.2rem;
51+
}
52+
53+
/* Backward-compatibility: docstring section titles in bold. */
54+
.doc-section-title {
55+
font-weight: bold;
56+
}
57+
58+
/* Backlinks crumb separator. */
59+
.doc-backlink-crumb {
60+
display: inline-flex;
61+
gap: .2rem;
62+
white-space: nowrap;
63+
align-items: center;
64+
vertical-align: middle;
65+
}
66+
.doc-backlink-crumb:not(:first-child)::before {
67+
background-color: var(--md-default-fg-color--lighter);
68+
content: "";
69+
display: inline;
70+
height: 1rem;
71+
--md-path-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6z"/></svg>');
72+
-webkit-mask-image: var(--md-path-icon);
73+
mask-image: var(--md-path-icon);
74+
width: 1rem;
75+
}
76+
.doc-backlink-crumb.last {
77+
font-weight: bold;
78+
}
79+
80+
/* Symbols in Navigation and ToC. */
81+
:root, :host,
82+
[data-md-color-scheme="default"] {
83+
--doc-symbol-parameter-fg-color: #df50af;
84+
--doc-symbol-type_parameter-fg-color: #df50af;
85+
--doc-symbol-attribute-fg-color: #953800;
86+
--doc-symbol-function-fg-color: #8250df;
87+
--doc-symbol-method-fg-color: #8250df;
88+
--doc-symbol-class-fg-color: #0550ae;
89+
--doc-symbol-type_alias-fg-color: #0550ae;
90+
--doc-symbol-module-fg-color: #5cad0f;
91+
92+
--doc-symbol-parameter-bg-color: #df50af1a;
93+
--doc-symbol-type_parameter-bg-color: #df50af1a;
94+
--doc-symbol-attribute-bg-color: #9538001a;
95+
--doc-symbol-function-bg-color: #8250df1a;
96+
--doc-symbol-method-bg-color: #8250df1a;
97+
--doc-symbol-class-bg-color: #0550ae1a;
98+
--doc-symbol-type_alias-bg-color: #0550ae1a;
99+
--doc-symbol-module-bg-color: #5cad0f1a;
100+
}
101+
102+
[data-md-color-scheme="slate"] {
103+
--doc-symbol-parameter-fg-color: #ffa8cc;
104+
--doc-symbol-type_parameter-fg-color: #ffa8cc;
105+
--doc-symbol-attribute-fg-color: #ffa657;
106+
--doc-symbol-function-fg-color: #d2a8ff;
107+
--doc-symbol-method-fg-color: #d2a8ff;
108+
--doc-symbol-class-fg-color: #79c0ff;
109+
--doc-symbol-type_alias-fg-color: #79c0ff;
110+
--doc-symbol-module-fg-color: #baff79;
111+
112+
--doc-symbol-parameter-bg-color: #ffa8cc1a;
113+
--doc-symbol-type_parameter-bg-color: #ffa8cc1a;
114+
--doc-symbol-attribute-bg-color: #ffa6571a;
115+
--doc-symbol-function-bg-color: #d2a8ff1a;
116+
--doc-symbol-method-bg-color: #d2a8ff1a;
117+
--doc-symbol-class-bg-color: #79c0ff1a;
118+
--doc-symbol-type_alias-bg-color: #79c0ff1a;
119+
--doc-symbol-module-bg-color: #baff791a;
120+
}
121+
122+
code.doc-symbol {
123+
border-radius: .1rem;
124+
font-size: .85em;
125+
padding: 0 .3em;
126+
font-weight: bold;
127+
}
128+
129+
code.doc-symbol-parameter,
130+
a code.doc-symbol-parameter {
131+
color: var(--doc-symbol-parameter-fg-color);
132+
background-color: var(--doc-symbol-parameter-bg-color);
133+
}
134+
135+
code.doc-symbol-parameter::after {
136+
content: "param";
137+
}
138+
139+
code.doc-symbol-type_parameter,
140+
a code.doc-symbol-type_parameter {
141+
color: var(--doc-symbol-type_parameter-fg-color);
142+
background-color: var(--doc-symbol-type_parameter-bg-color);
143+
}
144+
145+
code.doc-symbol-type_parameter::after {
146+
content: "type-param";
147+
}
148+
149+
code.doc-symbol-attribute,
150+
a code.doc-symbol-attribute {
151+
color: var(--doc-symbol-attribute-fg-color);
152+
background-color: var(--doc-symbol-attribute-bg-color);
153+
}
154+
155+
code.doc-symbol-attribute::after {
156+
content: "attr";
157+
}
158+
159+
code.doc-symbol-function,
160+
a code.doc-symbol-function {
161+
color: var(--doc-symbol-function-fg-color);
162+
background-color: var(--doc-symbol-function-bg-color);
163+
}
164+
165+
code.doc-symbol-function::after {
166+
content: "func";
167+
}
168+
169+
code.doc-symbol-method,
170+
a code.doc-symbol-method {
171+
color: var(--doc-symbol-method-fg-color);
172+
background-color: var(--doc-symbol-method-bg-color);
173+
}
174+
175+
code.doc-symbol-method::after {
176+
content: "meth";
177+
}
178+
179+
code.doc-symbol-class,
180+
a code.doc-symbol-class {
181+
color: var(--doc-symbol-class-fg-color);
182+
background-color: var(--doc-symbol-class-bg-color);
183+
}
184+
185+
code.doc-symbol-class::after {
186+
content: "class";
187+
}
188+
189+
190+
code.doc-symbol-type_alias,
191+
a code.doc-symbol-type_alias {
192+
color: var(--doc-symbol-type_alias-fg-color);
193+
background-color: var(--doc-symbol-type_alias-bg-color);
194+
}
195+
196+
code.doc-symbol-type_alias::after {
197+
content: "type";
198+
}
199+
200+
code.doc-symbol-module,
201+
a code.doc-symbol-module {
202+
color: var(--doc-symbol-module-fg-color);
203+
background-color: var(--doc-symbol-module-bg-color);
204+
}
205+
206+
code.doc-symbol-module::after {
207+
content: "mod";
208+
}
209+
210+
.doc-signature .autorefs {
211+
color: inherit;
212+
border-bottom: 1px dotted currentcolor;
213+
}

assets/images/favicon.png

1.83 KB
Loading

0 commit comments

Comments
 (0)