Skip to content

Commit 4d3380a

Browse files
committed
0 parents  commit 4d3380a

File tree

111 files changed

+34724
-0
lines changed

Some content is hidden

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

111 files changed

+34724
-0
lines changed

.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 5255abc07ec372c185ebac0c40b91438
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

.extra_resources.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"/home/runner/work/nbsite/nbsite/site/doc/playground/pyodide/index.md": {"css": [], "js": ["https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js"], "js_exports": {}, "js_modules": {}}, "/home/runner/work/nbsite/nbsite/site/doc/playground/pyodide/holoviz.md": {"css": [], "js": ["https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js"], "js_exports": {}, "js_modules": {}}}

.nojekyll

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"e73b48e8e00d36304ea7204a0683c814": [null, null, "hello\n", "", ["https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.2/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js"], {}, {}, [], []]}

.pyodide/76abbd8056ddd6e9cb44cf3e1c838598.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

PyodideServiceWorker.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const appName = 'nbsite'
2+
const appCacheName = 'nbsite-0.8.6rc10';
3+
4+
const preCacheFiles = [];
5+
6+
const cachePatterns = ['https://cdn.holoviz.org/panel/1.5.2/dist/', 'https://cdn.bokeh.org/bokeh/', 'https://cdn.jsdelivr.net/pyodide/', 'https://files.pythonhosted.org/packages/', 'https://pypi.org/pypi/'];
7+
8+
self.addEventListener('install', (e) => {
9+
console.log('[Service Worker] Install');
10+
self.skipWaiting();
11+
e.waitUntil((async () => {
12+
const cacheNames = await caches.keys();
13+
for (const cacheName of cacheNames) {
14+
if (cacheName.startsWith(appName) && cacheName !== appCacheName) {
15+
console.log(`[Service Worker] Delete old cache ${cacheName}`);
16+
caches.delete(cacheName);
17+
}
18+
}
19+
const cache = await caches.open(appCacheName);
20+
if (preCacheFiles.length) {
21+
console.log('[Service Worker] Precaching ');
22+
}
23+
preCacheFiles.forEach(async (cacheFile) => {
24+
const request = new Request(cacheFile);
25+
const response = await fetch(request);
26+
if (response.ok || response.type == 'opaque') {
27+
cache.put(request, response);
28+
}
29+
})
30+
})());
31+
});
32+
33+
self.addEventListener('activate', (event) => {
34+
console.log('[Service Worker] Activating');
35+
return self.clients.claim();
36+
});
37+
38+
self.addEventListener('fetch', (e) => {
39+
if (e.request.method !== 'GET') {
40+
return
41+
}
42+
e.respondWith((async () => {
43+
const cache = await caches.open(appCacheName);
44+
let response = await cache.match(e.request);
45+
console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
46+
if (response) {
47+
return response;
48+
}
49+
response = await fetch(e.request);
50+
if (!response.ok && !(response.type == 'opaque')) {
51+
throw Error(`[Service Worker] Fetching resource ${e.request.url} failed with response: ${response.status}`);
52+
}
53+
console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
54+
if (e.request.mode !== 'no-cors') {
55+
cache.put(e.request, response.clone());
56+
}
57+
return response;
58+
})());
59+
});

_images/example1.png

32.3 KB
Loading

_images/example2.png

32.3 KB
Loading

_images/thing1.png

32.3 KB
Loading

_images/thing2.png

32.3 KB
Loading

_rediraffe_redirected.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

_sphinx_design_static/design-tabs.js

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// @ts-check
2+
3+
// Extra JS capability for selected tabs to be synced
4+
// The selection is stored in local storage so that it persists across page loads.
5+
6+
/**
7+
* @type {Record<string, HTMLElement[]>}
8+
*/
9+
let sd_id_to_elements = {};
10+
const storageKeyPrefix = "sphinx-design-tab-id-";
11+
12+
/**
13+
* Create a key for a tab element.
14+
* @param {HTMLElement} el - The tab element.
15+
* @returns {[string, string, string] | null} - The key.
16+
*
17+
*/
18+
function create_key(el) {
19+
let syncId = el.getAttribute("data-sync-id");
20+
let syncGroup = el.getAttribute("data-sync-group");
21+
if (!syncId || !syncGroup) return null;
22+
return [syncGroup, syncId, syncGroup + "--" + syncId];
23+
}
24+
25+
/**
26+
* Initialize the tab selection.
27+
*
28+
*/
29+
function ready() {
30+
// Find all tabs with sync data
31+
32+
/** @type {string[]} */
33+
let groups = [];
34+
35+
document.querySelectorAll(".sd-tab-label").forEach((label) => {
36+
if (label instanceof HTMLElement) {
37+
let data = create_key(label);
38+
if (data) {
39+
let [group, id, key] = data;
40+
41+
// add click event listener
42+
// @ts-ignore
43+
label.onclick = onSDLabelClick;
44+
45+
// store map of key to elements
46+
if (!sd_id_to_elements[key]) {
47+
sd_id_to_elements[key] = [];
48+
}
49+
sd_id_to_elements[key].push(label);
50+
51+
if (groups.indexOf(group) === -1) {
52+
groups.push(group);
53+
// Check if a specific tab has been selected via URL parameter
54+
const tabParam = new URLSearchParams(window.location.search).get(
55+
group
56+
);
57+
if (tabParam) {
58+
console.log(
59+
"sphinx-design: Selecting tab id for group '" +
60+
group +
61+
"' from URL parameter: " +
62+
tabParam
63+
);
64+
window.sessionStorage.setItem(storageKeyPrefix + group, tabParam);
65+
}
66+
}
67+
68+
// Check is a specific tab has been selected previously
69+
let previousId = window.sessionStorage.getItem(
70+
storageKeyPrefix + group
71+
);
72+
if (previousId === id) {
73+
// console.log(
74+
// "sphinx-design: Selecting tab from session storage: " + id
75+
// );
76+
// @ts-ignore
77+
label.previousElementSibling.checked = true;
78+
}
79+
}
80+
}
81+
});
82+
}
83+
84+
/**
85+
* Activate other tabs with the same sync id.
86+
*
87+
* @this {HTMLElement} - The element that was clicked.
88+
*/
89+
function onSDLabelClick() {
90+
let data = create_key(this);
91+
if (!data) return;
92+
let [group, id, key] = data;
93+
for (const label of sd_id_to_elements[key]) {
94+
if (label === this) continue;
95+
// @ts-ignore
96+
label.previousElementSibling.checked = true;
97+
}
98+
window.sessionStorage.setItem(storageKeyPrefix + group, id);
99+
}
100+
101+
document.addEventListener("DOMContentLoaded", ready, false);

_sphinx_design_static/sphinx-design.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)