-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
368 lines (338 loc) · 11.8 KB
/
index.html
File metadata and controls
368 lines (338 loc) · 11.8 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>Mathics3 Live Shell</title>
<style>
:root {
--primary-color: #16599c;
--primary-light: #2171c7;
--text-color: #333;
--bg-color: #f5f7fa;
--card-bg: #ffffff;
}
.container,
.sidebar_card,
.row,
#main,
aside {
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
margin: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background-color: var(--primary-color);
padding: 1rem 0;
margin-bottom: 2rem;
}
header h1 a {
color: white;
text-decoration: none;
font-size: 1.8rem;
}
header h1 a:hover {
color: #e0e0e0;
}
.row {
display: flex;
gap: 2rem;
margin-bottom: 2rem;
}
#main {
flex: 1;
}
aside {
width: 300px;
}
h1, h2, h3 {
color: var(--primary-color);
margin-bottom: 1rem;
}
.sidebar_card {
background: var(--card-bg);
border-radius: 8px;
padding: 0.5rem 1.5rem;
margin-bottom: 1.5rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
iframe {
border: 1px solid #ddd;
border-radius: 8px;
margin-bottom: 1.5rem;
}
pre {
background: #f1f1f1;
padding: 1rem;
border-radius: 4px;
overflow-x: auto;
margin: 1rem 0;
}
a {
color: var(--primary-color);
text-decoration: none;
}
a:hover {
color: var(--primary-light);
text-decoration: underline;
}
footer {
border-top: 1px solid #ddd;
padding: 2rem 0;
text-align: center;
color: #666;
}
footer p {
margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
.row {
flex-direction: column;
}
aside {
width: 100%;
}
}
</style>
<script>
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
}
function statementsToCodes(statements) {
var statements = statements
.replace('\r\n', '\n')
.replace('\r', '\n')
.split(/#--[^\n]*/);
var codes = [];
for (const idx in statements) {
statement = statements[idx].trim()
if (statement) {
codes.push(statement);
}
}
return codes;
}
document.addEventListener('DOMContentLoaded', function() {
var iframe_src = "./repl/index.html?toolbar=1&kernel=python&code=%25pip%20install%20Mathics3%20Mathics3-notebook-frontends%0A%25load_ext%20mathics3_kernel.frontend.jupyter";
var statements = getURLParameter('evaluate');
if (statements) {
codes = statementsToCodes(statements);
for (const idx in codes) {
iframe_src += '&code=' + encodeURIComponent(codes[idx]);
}
}
document.getElementById('live-iframe').src = iframe_src;
});
</script>
<!--
# jupyter-config-data
The JSON in `jupyter-lite.json` is the last that will be loaded by most
child `index.html` pages, and every field can be overridden.
See the recognized schema as described in the documentation:
- https://jupyterlite.rtfd.io/en/latest/reference/schema.html
Notes
- fields that...
- are relative paths values
- will have the parent directory of _this_ file appended, accounting
for "magic" hosts which redirect to `{:path}index.html` to `{:path}`,
with or without a slash
- some fields, such as `federated_extensions` will be _added together_
-->
<script id="jupyter-config-data" type="application/json" data-jupyter-lite-root=".">
{}
</script>
<!--
# jupyter-lite-root
The source of truth for relative path locations. The `.` means _this_
is the root, and will redirect to the `appUrl` defined in
`.jupyter-lite/#jupyter-config-data`.
-->
<script type="module">
// await import('./config-utils.js');
</script>
<!-- that's it, there shouldn't be anything below here in head! -->
</head>
<body>
<header style="display: flex; align-items: center; justify-content: flex-start; width: 100%; padding: 20px 0;">
<!-- Heptatom Logo: With padding at the end to separate it from the Mathics3 logo. -->
<a href="https://mathics.org"
target="_blank"
rel="noopener noreferrer"
style="text-decoration: none; display: inline-block; line-height: 0; padding-left: 30px; padding-right: 30px;">
<svg width="10mm" height="10mm" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
<rect width="100%" height="100%" fill="white" />
<defs>
<radialGradient id="h_grad" cx="1729.18" cy="521.34" r="12.19" gradientTransform="matrix(10.49,0,0,10.49,-17867,-4878)" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color:#000000;stop-opacity:0.6" />
<stop offset="1" style="stop-color:#1e1e1e;stop-opacity:1" />
</radialGradient>
</defs>
<g transform="translate(-155.16,-466.04)">
<path style="fill:none; stroke:url(#h_grad); stroke-width:10.5;" d="m 282.6,636.1 c -374.6,0 266.1,-308.5 32.6,-15.5 C 81.6,913.5 239.6,220.0 322.9,585.4 406.3,950.7 -37.0,394.8 300.4,557.4 637.9,720.0 -72.6,720.3 264.8,557.8 602.3,395.2 159.2,950.0 242.6,584.7 325.9,219.4 485.1,549.3 251.5,256.3 -233.5,-36.6 405.6,270.7 31.0,270.7 Z M 164.6,557.4 c 14.0,-43.1 73.0,-86.1 118.5,-86.1 45.4,0 104.4,42.9 118.5,86.1 14.0,43.1 -8.5,112.6 -45.2,139.3 -36.7,26.6 -109.7,26.6 -146.4,0 -36.7,-26.6 -59.2,-96.1 -45.2,-139.3 z" />
</g>
</svg>
</a>
<!-- Mathics3 Logo: separated from Heptatom Logo margin -->
<a href="https://mathics.org" target="_blank" rel="noopener noreferrer" style="text-decoration: none; display: inline-block; line-height: 0; vertical-align: middle;">
<svg
width="41.346001mm"
height="14.768923mm"
viewBox="0 0 41.346001 14.768923"
version="1.1"
id="svg20493"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="Mathics3-logo.svg"
inkscape:export-filename="drawing.svg"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview20495"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2"
inkscape:cx="267.75"
inkscape:cy="52.25"
inkscape:window-width="1854"
inkscape:window-height="1011"
inkscape:window-x="1146"
inkscape:window-y="872"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs20490">
<linearGradient
inkscape:collect="always"
id="linearGradient20533">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop20529" />
<stop
style="stop-color:#f4e3d7;stop-opacity:1"
offset="1"
id="stop20531" />
</linearGradient>
<rect
x="29.996094"
y="20.992188"
width="37.498962"
height="57.498413"
id="rect20505" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient20533"
id="linearGradient20535"
x1="11.727519"
y1="7.0216355"
x2="13.798133"
y2="-20.792307"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.85742597,0,0.10905561,1.1662814,0.35498423,-1.7059788)" />
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-1.1178945,-1.4609905)">
<text
xml:space="preserve"
style="font-size:10.5833px;font-family:'Times New Roman';-inkscape-font-specification:'Times New Roman, ';stroke-width:0.264583"
x="1.1141716"
y="8.8093557"
id="text20499">
<tspan
sodipodi:role="line"
id="tspan20497"
style="stroke-width:0.264583"
x="1.1141716"
y="8.8093557">Mathics3
</tspan>
</text>
<text
xml:space="preserve"
transform="scale(0.26458333)"
id="text20503"
style="font-size:40px;font-family:'Times New Roman';-inkscape-font-specification:'Times New Roman, ';white-space:pre;shape-inside:url(#rect20505);display:inline" />
<text
xml:space="preserve"
style="font-size:9.08537px;font-family:'Times New Roman';-inkscape-font-specification:'Times New Roman, ';fill:url(#linearGradient20535);fill-opacity:1;stroke-width:0.227133"
x="-3.6577182"
y="-12.643151"
id="text20513"
transform="matrix(1.1676865,0,-0.41230535,-0.85639427,0,0)">
<tspan
sodipodi:role="line"
id="tspan20511"
style="fill:url(#linearGradient20535);fill-opacity:1;stroke-width:0.227133"
x="-3.6577182"
y="-12.643151">Mathics3
</tspan>
</text>
</g>
</svg>
</a>
</header>
<div class="container">
<section class="row" id="main">
<div id="content">
<h1 style="margin-top: 0;">Mathics3 Live Shell</h1>
<iframe
id="live-iframe"
width="100%"
height="500px"
>
</iframe>
<div id="about_shell" class="sidebar_card">
<h3>About this page</h3>
<p>Mathics3 Live shell allows you to use Mathics3 in the browser without the need to install anything on your computer.</p>
<p>The following commands are executed by default:</p>
<pre>[1]: %pip install Mathics3 Mathics3-notebook-frontends
%load_ext mathics3_kernel.frontend.jupyter</pre>
<p>Mathics3 Live shell is powered by <a href="https://jupyterlite.readthedocs.io/en/stable/">JupyterLite</a>. It can take up to 30 seconds before the shell code and libraries load completely and become available for using interactively.</p>
</div>
</div>
<aside id="sidebar">
<div id="usage" class="sidebar_card">
<h3>Instructions</h3>
<div class="content">
<p>Press <strong>SHIFT+ENTER</strong> to run the code or use the Run button in the toolbar.</p>
<p id="loading_message">Note it can take up to <strong>30 seconds</strong> before the shell finishes loading and is ready to run commands.</p>
</div>
</div>
<div id="examples" class="sidebar_card">
<h3>Example session</h3>
<div class="content">
<p><a href="./lab/index.html?path=mathics.ipynb">Mathics3 Demo Notebook</a></p>
</div>
</div>
</aside>
</section>
<footer>
<p>Copyright © 2025-2026 Mathics3 Development Team.</p>
<p>This page is open source. Fork <a href="https://github.com/Mathics3">the project on GitHub</a> to edit it.</p>
</footer>
</div>
</body>
</html>