-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
83 lines (75 loc) · 10.5 KB
/
index.html
File metadata and controls
83 lines (75 loc) · 10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./favicon.ico" />
<!-- Preload is necessary because we show these images when we disconnect from the server,
but at that point we cannot load these images from the server -->
<link rel="preload" href="./assets/gradient-yHQUC_QB.png" as="image" />
<link rel="preload" href="./assets/noise-60BoTA8O.png" as="image" />
<!-- Preload the fonts -->
<link rel="preload" href="./assets/Lora-VariableFont_wght-B2ootaw-.ttf" as="font" crossorigin="anonymous" />
<link rel="preload" href="./assets/PTSans-Regular-CxL0S8W7.ttf" as="font" crossorigin="anonymous" />
<link rel="preload" href="./assets/PTSans-Bold-D9fedIX3.ttf" as="font" crossorigin="anonymous" />
<link rel="preload" href="./assets/FiraMono-Regular-BTCkDNvf.ttf" as="font" crossorigin="anonymous" />
<link rel="preload" href="./assets/FiraMono-Medium-DU3aDxX5.ttf" as="font" crossorigin="anonymous" />
<link rel="preload" href="./assets/FiraMono-Bold-CLVRCuM9.ttf" as="font" crossorigin="anonymous" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="a marimo app" />
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
<link rel="manifest" href="./manifest.json" />
<script data-marimo="true">
function __resizeIframe(obj) {
var scrollbarHeight = 20; // Max between windows, mac, and linux
function setHeight() {
var element = obj.contentWindow.document.documentElement;
// If there is no vertical scrollbar, we don't need to resize the iframe
if (element.scrollHeight === element.clientHeight) {
return;
}
// Create a new height that includes the scrollbar height if it's visible
var hasHorizontalScrollbar = element.scrollWidth > element.clientWidth;
var newHeight = element.scrollHeight + (hasHorizontalScrollbar ? scrollbarHeight : 0);
// Only update the height if it's different from the current height
if (obj.style.height !== `${newHeight}px`) {
obj.style.height = `${newHeight}px`;
}
}
// Resize the iframe to the height of the content and bottom scrollbar height
setHeight();
// Resize the iframe when the content changes
const resizeObserver = new ResizeObserver((entries) => {
setHeight();
});
resizeObserver.observe(obj.contentWindow.document.body);
}
</script>
<marimo-filename hidden>notebook.py</marimo-filename>
<marimo-mode data-mode='read' hidden></marimo-mode>
<marimo-version data-version='0.11.8' hidden></marimo-version>
<marimo-user-config data-config='{"completion": {"activate_on_typing": true, "copilot": false}, "display": {"code_editor_font_size": 14, "cell_output": "above", "default_width": "medium", "dataframes": "rich", "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"preset": "default", "overrides": {}}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "on_cell_change": "autorun", "watcher_on_save": "lazy", "output_max_bytes": 8000000, "std_stream_max_bytes": 1000000}, "save": {"autosave": "off", "autosave_delay": 1000, "format_on_save": false}, "package_management": {"manager": "pip"}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}}' data-overrides='{}' hidden></marimo-user-config>
<marimo-app-config data-config='{"width": "compact", "app_title": "", "css_file": ""}' hidden></marimo-app-config>
<marimo-server-token data-token='123' hidden></marimo-server-token>
<title></title>
<script type="module" crossorigin src="./assets/index-mdf3hACe.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DkqMrX_B.css">
<marimo-wasm hidden=""></marimo-wasm>
<script>
if (window.location.protocol === 'file:') {
alert('Warning: This file must be served by an HTTP server to function correctly.');
}
</script>
<style>
#save-button {
display: none !important;
}
#filename-input {
display: none !important;
}
</style>
<marimo-code hidden="" data-show-code="false">import%20marimo%0A%0A__generated_with%20%3D%20%220.11.8%22%0Aapp%20%3D%20marimo.App(app_title%3D%22%22%2C%20css_file%3D%22%22)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20%22%22%22%0A%20%20%20%20Export%20to%20WASM-powered%20HTML%3A%0A%20%20%20%20%20%20%20%20uv%20run%20marimo%20export%20html-wasm%20notebook.py%20-o%20.%20--mode%20run%0A%0A%20%20%20%20Serve%20locally%3A%0A%20%20%20%20%20%20%20%20uv%20run%20-m%20http.server%20--directory%20.%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20from%20itertools%20import%20cycle%0A%20%20%20%20from%20urllib.parse%20import%20urlencode%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20with%20mo.status.spinner(%22loading%20snakes%20on%20a%20browser...%22)%3A%0A%20%20%20%20%20%20%20%20%23%20import%20micropip%0A%20%20%20%20%20%20%20%20%23%20await%20micropip.install('requests')%0A%20%20%20%20%20%20%20%20import%20requests%0A%0A%20%20%20%20%23%20get%20and%20set%20login%20name%20from%20query%20param%0A%20%20%20%20%23%20if%20_no_%20login%20param%2C%20then%20login%20is%20eidorb%0A%20%20%20%20%23%20otherwise%20login%20is%20set%20to%20login%20param%0A%20%20%20%20%23%20if%20login%20param%20_present_%20but%20empty%2C%0A%20%20%20%20%23%20app%20will%20be%20in%20an%20%22uninitialised%22%20state%0A%20%20%20%20query_params%20%3D%20mo.query_params()%0A%20%20%20%20login%20%3D%20mo.ui.text(%0A%20%20%20%20%20%20%20%20value%3D%22eidorb%22%0A%20%20%20%20%20%20%20%20if%20query_params%5B%22login%22%5D%20is%20None%20%20%23%0A%20%20%20%20%20%20%20%20else%20query_params%5B%22login%22%5D%2C%0A%20%20%20%20%20%20%20%20on_change%3Dlambda%20value%3A%20query_params.set(%22login%22%2C%20value)%2C%0A%20%20%20%20)%0A%20%20%20%20return%20cycle%2C%20login%2C%20mo%2C%20query_params%2C%20requests%2C%20urlencode%0A%0A%0A%40app.cell%0Adef%20_(avatar_url%2C%20login%2C%20mo%2C%20query_params%2C%20urlencode)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20%2F%2F%2F%20details%20%7C%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.image(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20avatar_url%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20width%3D123%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20rounded%3DTrue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20caption%3Df%22%7Blogin.value%7D's%20projects%22%20if%20login.value%20else%20None%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20).center()%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20This%20webpage%20is%20interactive!%0A%0A%20%20%20%20%20%20%20%20Enter%20your%20GitHub%20login%3A%20%7Blogin%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%2F%20admonition%20%7C%20Come%20again%0A%0A%20%20%20%20%20%20%20%20%20%20Changing%20the%20login%20updates%20this%20page's%20URL.%0A%20%20%20%20%20%20%20%20%20%20Use%20it%20to%20come%20back%20to%20the%20same%20state%3A%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.ui.text(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%7Bstr(mo.notebook_location())%7D%3F%7Burlencode(query_params.to_dict())%7D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20full_width%3DTrue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%2F%0A%20%20%20%20%20%20%20%20%2F%2F%2F%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(cycle%2C%20login%2C%20mo%2C%20requests)%3A%0A%20%20%20%20%23%20get%20avatar%20or%20placeholder%20if%20user%20not%20found%20%3A(%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20with%20mo.status.spinner()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20response%20%3D%20requests.get(f%22https%3A%2F%2Fapi.github.com%2Fusers%2F%7Blogin.value%7D%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20response.raise_for_status()%0A%20%20%20%20%20%20%20%20%20%20%20%20user%20%3D%20response.json()%0A%20%20%20%20%20%20%20%20%20%20%20%20repos%20%3D%20requests.get(user%5B%22repos_url%22%5D).json()%0A%20%20%20%20%20%20%20%20%20%20%20%20avatar_url%20%3D%20user%5B%22avatar_url%22%5D%0A%20%20%20%20except%20requests.HTTPError%3A%0A%20%20%20%20%20%20%20%20user%20%3D%20None%0A%20%20%20%20%20%20%20%20avatar_url%20%3D%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22https%3A%2F%2Fgithub.githubassets.com%2Fimages%2Fmodules%2Flogos_page%2FGitHub-Mark.png%22%0A%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20%23%20filter%20my%20repos%3A%20not%20forks%3B%20have%20a%20homepage%20link%0A%20%20%20%20if%20user%3A%0A%20%20%20%20%20%20%20%20projects%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20repo%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20repo%20in%20repos%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20repo%5B%22fork%22%5D%20and%20repo%5B%22homepage%22%5D%20and%20repo%5B%22name%22%5D%20!%3D%20%22eidorb.github.io%22%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%23%20no%20user%20has%20no%20repos%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20projects%20%3D%20%5B%5D%0A%0A%20%20%20%20%23%20use%20differnt%20types%20of%20details%20to%20style%20with%20colour%0A%20%20%20%20for%20repo%2C%20type%20in%20zip(projects%2C%20cycle(%5B%22info%22%2C%20%22warn%22%2C%20%22danger%22%2C%20%22success%22%5D))%3A%0A%20%20%20%20%20%20%20%20mo.output.append(%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%2F%20details%20%7C%20%5B%7Brepo%5B%22name%22%5D%7D%5D(%7Brepo%5B%22homepage%22%5D%7D)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20%7Btype%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Brepo%5B%22description%22%5D%7D%20%5B%3A%3Aline-md%3Agithub-loop%3A%3A%5D(%7Brepo%5B%22html_url%22%5D%7D)%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20return%20avatar_url%2C%20projects%2C%20repo%2C%20repos%2C%20response%2C%20type%2C%20user%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%3Csmall%3EHack%20on%20your%20own%20copy%20of%20this%20notebook%20%5Bhere%5D(https%3A%2F%2Fmarimo.app%2Fhttps%3A%2F%2Feidorb.github.io%2Fnotebook.py).%3C%2Fsmall%3E%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A</marimo-code></head>
<body>
<div id="root"></div>
</body>
</html>