Skip to content

Commit 082d540

Browse files
committed
Deploying to gh-pages from @ 278e126 🚀
1 parent 7f39da3 commit 082d540

22 files changed

+2063
-135
lines changed

examples/blog/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ <h5 class="quarto-listing-category-title">Categories</h5><div class="quarto-list
205205

206206
<div class="quarto-listing quarto-listing-container-default" id="listing-listing">
207207
<div class="list quarto-listing-default">
208-
<div class="quarto-post image-right" data-index="0" data-categories="news,code,analysis" data-listing-date-sort="1710201600000" data-listing-file-modified-sort="1709282716930" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="41">
208+
<div class="quarto-post image-right" data-index="0" data-categories="news,code,analysis" data-listing-date-sort="1710201600000" data-listing-file-modified-sort="1709373866747" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="41">
209209
<div class="thumbnail">
210210
<p><a href="./posts/post-with-code/index.html" class="no-external"></a></p><a href="./posts/post-with-code/index.html" class="no-external">
211211
<p><img src="./posts/post-with-code/image.jpg" class="thumbnail-image"></p>
@@ -244,7 +244,7 @@ <h3 class="no-anchor listing-title">
244244
</a>
245245
</div>
246246
</div>
247-
<div class="quarto-post image-right" data-index="1" data-categories="news,code,analysis" data-listing-date-sort="1708300800000" data-listing-file-modified-sort="1709282716930" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="92">
247+
<div class="quarto-post image-right" data-index="1" data-categories="news,code,analysis" data-listing-date-sort="1708300800000" data-listing-file-modified-sort="1709373866747" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="92">
248248
<div class="thumbnail">
249249
<p><a href="./posts/embed-slides/index.html" class="no-external"></a></p><a href="./posts/embed-slides/index.html" class="no-external">
250250
<p><img src="./posts/embed-slides/image.jpg" class="thumbnail-image"></p>

examples/blog/posts/post-with-code/index.html

+30-8
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
}
231231

232232
// Store cell data
233-
globalThis.qpyodideCellDetails = [{"code":"print(\"Hello {quarto-pyodide} blog world!\")","options":{"fig-height":5,"context":"interactive","out-width":"700px","fig-width":7,"message":"true","label":"","output":"true","fig-cap":"","warning":"true","read-only":"false","autorun":"","classes":"","comment":"","dpi":72,"out-height":"","results":"markup"},"id":1}];
233+
globalThis.qpyodideCellDetails = [{"code":"print(\"Hello {quarto-pyodide} blog world!\")","id":1,"options":{"message":"true","fig-cap":"","classes":"","read-only":"false","output":"true","results":"markup","warning":"true","autorun":"","context":"interactive","dpi":72,"out-height":"","fig-width":7,"out-width":"700px","comment":"","fig-height":5,"label":""}}];
234234

235235

236236
</script>
@@ -255,11 +255,22 @@
255255

256256
// Function to update the status message
257257
globalThis.qpyodideUpdateStatusHeader = function(message) {
258-
qpyodideStartupMessage.innerHTML = `
258+
259+
if (!qpyodideShowStartupMessage) return;
260+
261+
qpyodideStartupMessage.innerHTML = message;
262+
}
263+
264+
// Status header update with customized spinner message
265+
globalThis.qpyodideUpdateStatusHeaderSpinner = function(message) {
266+
267+
qpyodideUpdateStatusHeader(`
259268
<i class="fa-solid fa-spinner fa-spin qpyodide-icon-status-spinner"></i>
260-
<span>${message}</span>`;
269+
<span>${message}</span>
270+
`);
261271
}
262272

273+
263274
// Function that attaches the document status message
264275
function qpyodideDisplayStartupMessage(showStartupMessage) {
265276
if (!showStartupMessage) {
@@ -354,11 +365,21 @@
354365

355366
// Setup a namespace for global scoping
356367
// await loadedPyodide.runPythonAsync("globalScope = {}");
368+
369+
// Update status to reflect the next stage of the procedure
370+
qpyodideUpdateStatusHeaderSpinner("Initializing Python Packages");
357371

358372
// Load the `micropip` package to allow installation of packages.
359373
await mainPyodide.loadPackage("micropip");
374+
await mainPyodide.runPythonAsync(`import micropip`);
375+
376+
// Load the `pyodide_http` package to shim uses of `requests` and `urllib3`.
377+
// This allows for `pd.read_csv(url)` to work flawlessly.
378+
// Details: https://github.com/coatless-quarto/pyodide/issues/9
379+
await mainPyodide.loadPackage("pyodide_http");
360380
await mainPyodide.runPythonAsync(`
361-
import micropip
381+
import pyodide_http
382+
pyodide_http.patch_all() # Patch all libraries
362383
`);
363384

364385
// Load the `matplotlib` package with necessary environment hook
@@ -375,11 +396,12 @@
375396
qpyodideSetInteractiveButtonState(
376397
`<i class="fa-solid fa-play qpyodide-icon-run-code"></i> <span>Run Code</span>`,
377398
true
378-
);
399+
);
379400

380-
if (qpyodideShowStartupMessage) {
381-
qpyodideStartupMessage.innerText = "🟢 Ready!"
382-
}
401+
// Set document status to viable
402+
qpyodideUpdateStatusHeader(
403+
"🟢 Ready!"
404+
);
383405

384406
// Assign Pyodide into the global environment
385407
globalThis.mainPyodide = mainPyodide;

examples/book/example-page.html

+30-8
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
}
231231

232232
// Store cell data
233-
globalThis.qpyodideCellDetails = [{"code":"import numpy as np\n\n# Data for plotting\nt = np.arange(0.0, 2.0, 0.01)\ns = 1 + np.sin(2 * np.pi * t)\n\n# Print t\nprint(f\"Displaying 10 observations of `t`:\\n{t[:10]}\\n\")\n\nprint(\"Showing the first 10 values of `s`:\")\n# The last object in the cell does not need print.\ns[:10]","id":1,"options":{"message":"true","comment":"","dpi":72,"fig-height":5,"classes":"","read-only":"false","label":"","fig-cap":"","out-width":"700px","out-height":"","context":"interactive","results":"markup","output":"true","autorun":"","warning":"true","fig-width":7}},{"code":"import matplotlib.pyplot as plt\n\nfig, ax = plt.subplots()\nax.plot(t, s)\n\nax.set(xlabel='time (s)', ylabel='voltage (mV)',\n title='About as simple as it gets, folks')\nax.grid()\n\nplt.show()","id":2,"options":{"message":"true","comment":"","dpi":72,"fig-height":5,"classes":"","read-only":"false","label":"","fig-cap":"","out-width":"700px","out-height":"","context":"interactive","results":"markup","output":"true","autorun":"","warning":"true","fig-width":7}}];
233+
globalThis.qpyodideCellDetails = [{"options":{"label":"","message":"true","warning":"true","out-height":"","read-only":"false","autorun":"","output":"true","fig-cap":"","context":"interactive","out-width":"700px","fig-height":5,"results":"markup","fig-width":7,"comment":"","classes":"","dpi":72},"code":"import numpy as np\n\n# Data for plotting\nt = np.arange(0.0, 2.0, 0.01)\ns = 1 + np.sin(2 * np.pi * t)\n\n# Print t\nprint(f\"Displaying 10 observations of `t`:\\n{t[:10]}\\n\")\n\nprint(\"Showing the first 10 values of `s`:\")\n# The last object in the cell does not need print.\ns[:10]","id":1},{"options":{"label":"","message":"true","warning":"true","out-height":"","read-only":"false","autorun":"","output":"true","fig-cap":"","context":"interactive","out-width":"700px","fig-height":5,"results":"markup","fig-width":7,"comment":"","classes":"","dpi":72},"code":"import matplotlib.pyplot as plt\n\nfig, ax = plt.subplots()\nax.plot(t, s)\n\nax.set(xlabel='time (s)', ylabel='voltage (mV)',\n title='About as simple as it gets, folks')\nax.grid()\n\nplt.show()","id":2}];
234234

235235

236236
</script>
@@ -255,11 +255,22 @@
255255

256256
// Function to update the status message
257257
globalThis.qpyodideUpdateStatusHeader = function(message) {
258-
qpyodideStartupMessage.innerHTML = `
258+
259+
if (!qpyodideShowStartupMessage) return;
260+
261+
qpyodideStartupMessage.innerHTML = message;
262+
}
263+
264+
// Status header update with customized spinner message
265+
globalThis.qpyodideUpdateStatusHeaderSpinner = function(message) {
266+
267+
qpyodideUpdateStatusHeader(`
259268
<i class="fa-solid fa-spinner fa-spin qpyodide-icon-status-spinner"></i>
260-
<span>${message}</span>`;
269+
<span>${message}</span>
270+
`);
261271
}
262272

273+
263274
// Function that attaches the document status message
264275
function qpyodideDisplayStartupMessage(showStartupMessage) {
265276
if (!showStartupMessage) {
@@ -354,11 +365,21 @@
354365

355366
// Setup a namespace for global scoping
356367
// await loadedPyodide.runPythonAsync("globalScope = {}");
368+
369+
// Update status to reflect the next stage of the procedure
370+
qpyodideUpdateStatusHeaderSpinner("Initializing Python Packages");
357371

358372
// Load the `micropip` package to allow installation of packages.
359373
await mainPyodide.loadPackage("micropip");
374+
await mainPyodide.runPythonAsync(`import micropip`);
375+
376+
// Load the `pyodide_http` package to shim uses of `requests` and `urllib3`.
377+
// This allows for `pd.read_csv(url)` to work flawlessly.
378+
// Details: https://github.com/coatless-quarto/pyodide/issues/9
379+
await mainPyodide.loadPackage("pyodide_http");
360380
await mainPyodide.runPythonAsync(`
361-
import micropip
381+
import pyodide_http
382+
pyodide_http.patch_all() # Patch all libraries
362383
`);
363384

364385
// Load the `matplotlib` package with necessary environment hook
@@ -375,11 +396,12 @@
375396
qpyodideSetInteractiveButtonState(
376397
`<i class="fa-solid fa-play qpyodide-icon-run-code"></i> <span>Run Code</span>`,
377398
true
378-
);
399+
);
379400

380-
if (qpyodideShowStartupMessage) {
381-
qpyodideStartupMessage.innerText = "🟢 Ready!"
382-
}
401+
// Set document status to viable
402+
qpyodideUpdateStatusHeader(
403+
"🟢 Ready!"
404+
);
383405

384406
// Assign Pyodide into the global environment
385407
globalThis.mainPyodide = mainPyodide;

examples/book/index.html

+32-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
88

99
<meta name="author" content="JJB">
10-
<meta name="dcterms.date" content="2024-03-01">
10+
<meta name="dcterms.date" content="2024-03-02">
1111

1212
<title>Sample quarto-pyodide Book Project</title>
1313
<style>
@@ -231,7 +231,7 @@
231231
}
232232

233233
// Store cell data
234-
globalThis.qpyodideCellDetails = [{"code":"print(\"Hello there! Welcome to a {quarto-pyodide} powered book!\")","options":{"fig-cap":"","label":"","autorun":"","fig-width":7,"warning":"true","comment":"","context":"interactive","classes":"","read-only":"false","message":"true","out-height":"","dpi":72,"results":"markup","out-width":"700px","output":"true","fig-height":5},"id":1}];
234+
globalThis.qpyodideCellDetails = [{"id":1,"code":"print(\"Hello there! Welcome to a {quarto-pyodide} powered book!\")","options":{"results":"markup","fig-cap":"","fig-width":7,"autorun":"","read-only":"false","fig-height":5,"classes":"","out-width":"700px","label":"","message":"true","comment":"","dpi":72,"output":"true","out-height":"","warning":"true","context":"interactive"}}];
235235

236236

237237
</script>
@@ -256,11 +256,22 @@
256256

257257
// Function to update the status message
258258
globalThis.qpyodideUpdateStatusHeader = function(message) {
259-
qpyodideStartupMessage.innerHTML = `
259+
260+
if (!qpyodideShowStartupMessage) return;
261+
262+
qpyodideStartupMessage.innerHTML = message;
263+
}
264+
265+
// Status header update with customized spinner message
266+
globalThis.qpyodideUpdateStatusHeaderSpinner = function(message) {
267+
268+
qpyodideUpdateStatusHeader(`
260269
<i class="fa-solid fa-spinner fa-spin qpyodide-icon-status-spinner"></i>
261-
<span>${message}</span>`;
270+
<span>${message}</span>
271+
`);
262272
}
263273

274+
264275
// Function that attaches the document status message
265276
function qpyodideDisplayStartupMessage(showStartupMessage) {
266277
if (!showStartupMessage) {
@@ -355,11 +366,21 @@
355366

356367
// Setup a namespace for global scoping
357368
// await loadedPyodide.runPythonAsync("globalScope = {}");
369+
370+
// Update status to reflect the next stage of the procedure
371+
qpyodideUpdateStatusHeaderSpinner("Initializing Python Packages");
358372

359373
// Load the `micropip` package to allow installation of packages.
360374
await mainPyodide.loadPackage("micropip");
375+
await mainPyodide.runPythonAsync(`import micropip`);
376+
377+
// Load the `pyodide_http` package to shim uses of `requests` and `urllib3`.
378+
// This allows for `pd.read_csv(url)` to work flawlessly.
379+
// Details: https://github.com/coatless-quarto/pyodide/issues/9
380+
await mainPyodide.loadPackage("pyodide_http");
361381
await mainPyodide.runPythonAsync(`
362-
import micropip
382+
import pyodide_http
383+
pyodide_http.patch_all() # Patch all libraries
363384
`);
364385

365386
// Load the `matplotlib` package with necessary environment hook
@@ -376,11 +397,12 @@
376397
qpyodideSetInteractiveButtonState(
377398
`<i class="fa-solid fa-play qpyodide-icon-run-code"></i> <span>Run Code</span>`,
378399
true
379-
);
400+
);
380401

381-
if (qpyodideShowStartupMessage) {
382-
qpyodideStartupMessage.innerText = "🟢 Ready!"
383-
}
402+
// Set document status to viable
403+
qpyodideUpdateStatusHeader(
404+
"🟢 Ready!"
405+
);
384406

385407
// Assign Pyodide into the global environment
386408
globalThis.mainPyodide = mainPyodide;
@@ -526,7 +548,7 @@ <h1 class="title">Sample quarto-pyodide Book Project</h1>
526548
<div>
527549
<div class="quarto-title-meta-heading">Published</div>
528550
<div class="quarto-title-meta-contents">
529-
<p class="date">March 1, 2024</p>
551+
<p class="date">March 2, 2024</p>
530552
</div>
531553
</div>
532554

examples/html-document/index.html

+30-8
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
}
196196

197197
// Store cell data
198-
globalThis.qpyodideCellDetails = [{"options":{"output":"true","context":"interactive","warning":"true","out-height":"","read-only":"false","dpi":72,"fig-cap":"","fig-width":7,"out-width":"700px","results":"markup","label":"","classes":"","autorun":"","fig-height":5,"message":"true","comment":""},"code":"print(\"Hello there! Welcome to a quarto-pyodide powered HTML Document!\")","id":1}];
198+
globalThis.qpyodideCellDetails = [{"options":{"message":"true","output":"true","autorun":"","context":"interactive","comment":"","results":"markup","read-only":"false","fig-cap":"","out-height":"","label":"","warning":"true","dpi":72,"fig-width":7,"classes":"","out-width":"700px","fig-height":5},"code":"print(\"Hello there! Welcome to a quarto-pyodide powered HTML Document!\")","id":1}];
199199

200200

201201
</script>
@@ -220,11 +220,22 @@
220220

221221
// Function to update the status message
222222
globalThis.qpyodideUpdateStatusHeader = function(message) {
223-
qpyodideStartupMessage.innerHTML = `
223+
224+
if (!qpyodideShowStartupMessage) return;
225+
226+
qpyodideStartupMessage.innerHTML = message;
227+
}
228+
229+
// Status header update with customized spinner message
230+
globalThis.qpyodideUpdateStatusHeaderSpinner = function(message) {
231+
232+
qpyodideUpdateStatusHeader(`
224233
<i class="fa-solid fa-spinner fa-spin qpyodide-icon-status-spinner"></i>
225-
<span>${message}</span>`;
234+
<span>${message}</span>
235+
`);
226236
}
227237

238+
228239
// Function that attaches the document status message
229240
function qpyodideDisplayStartupMessage(showStartupMessage) {
230241
if (!showStartupMessage) {
@@ -319,11 +330,21 @@
319330

320331
// Setup a namespace for global scoping
321332
// await loadedPyodide.runPythonAsync("globalScope = {}");
333+
334+
// Update status to reflect the next stage of the procedure
335+
qpyodideUpdateStatusHeaderSpinner("Initializing Python Packages");
322336

323337
// Load the `micropip` package to allow installation of packages.
324338
await mainPyodide.loadPackage("micropip");
339+
await mainPyodide.runPythonAsync(`import micropip`);
340+
341+
// Load the `pyodide_http` package to shim uses of `requests` and `urllib3`.
342+
// This allows for `pd.read_csv(url)` to work flawlessly.
343+
// Details: https://github.com/coatless-quarto/pyodide/issues/9
344+
await mainPyodide.loadPackage("pyodide_http");
325345
await mainPyodide.runPythonAsync(`
326-
import micropip
346+
import pyodide_http
347+
pyodide_http.patch_all() # Patch all libraries
327348
`);
328349

329350
// Load the `matplotlib` package with necessary environment hook
@@ -340,11 +361,12 @@
340361
qpyodideSetInteractiveButtonState(
341362
`<i class="fa-solid fa-play qpyodide-icon-run-code"></i> <span>Run Code</span>`,
342363
true
343-
);
364+
);
344365

345-
if (qpyodideShowStartupMessage) {
346-
qpyodideStartupMessage.innerText = "🟢 Ready!"
347-
}
366+
// Set document status to viable
367+
qpyodideUpdateStatusHeader(
368+
"🟢 Ready!"
369+
);
348370

349371
// Assign Pyodide into the global environment
350372
globalThis.mainPyodide = mainPyodide;

0 commit comments

Comments
 (0)