diff --git a/_sources/index.rst b/_sources/index.rst index f78eb8314d..c43ecc10c0 100644 --- a/_sources/index.rst +++ b/_sources/index.rst @@ -31,4 +31,5 @@ Contenidos: :maxdepth: 1 index_es - index_en \ No newline at end of file + index_en + pycomponent \ No newline at end of file diff --git a/_sources/index_en.rst b/_sources/index_en.rst index 07582b56c2..c5a5cb9814 100644 --- a/_sources/index_en.rst +++ b/_sources/index_en.rst @@ -34,6 +34,7 @@ Contents: lectures/TWP58/toctree_en lectures/TWP60/toctree_en lectures/TWP65/toctree_en + lectures/TWP67/toctree_en quiz/Quiz1_en.rst quiz/Quiz2_en.rst quiz/Quiz3_en.rst diff --git a/_sources/index_es.rst b/_sources/index_es.rst index ecf1551c24..1cb3b96bca 100644 --- a/_sources/index_es.rst +++ b/_sources/index_es.rst @@ -34,6 +34,7 @@ Contenidos: lectures/TWP58/toctree lectures/TWP60/toctree lectures/TWP65/toctree + lectures/TWP67/toctree quiz/Quiz1.rst quiz/Quiz2.rst quiz/Quiz3.rst diff --git a/_sources/lectures/TWP67/TWP67_1_en.rst b/_sources/lectures/TWP67/TWP67_1_en.rst new file mode 100644 index 0000000000..ff0a1c241a --- /dev/null +++ b/_sources/lectures/TWP67/TWP67_1_en.rst @@ -0,0 +1,55 @@ +=== +PoC +=== + +Try These +--------- + + +.. code-block:: python + + import numpy as np + import matplotlib.pyplot as plt + from pyscript import display + + # Define the domain + N = 55 + X = np.linspace(-5, 5, N) + Y = np.sin(X) + + # Plotting the values + plt.plot(X, Y, 'b-') + plt.grid(True) + + # Display a message + print("The plot is displayed below:") + + # Display the plot on the webpage + display(plt, target="output", append=False) + +.. code-block:: python + + import ltk + + # Clear the output div before adding new content + ltk.find("#output").empty() + + # Create and append new elements to the output div + ( + ltk.VBox( + ltk.HBox( + ltk.Text("Hello"), + ltk.Button( + "World", + lambda event: + ltk.find(".ltk-button, a") + .css("color", "red") + ) + .css("color", "blue") + ) + ) + .appendTo(ltk.find("#output")) # Append to the output div + ) + +.. raw:: html + :file: ../_static/index1.html diff --git a/_sources/lectures/TWP67/toctree.rst b/_sources/lectures/TWP67/toctree.rst new file mode 100644 index 0000000000..5dddc02da3 --- /dev/null +++ b/_sources/lectures/TWP67/toctree.rst @@ -0,0 +1,18 @@ +========== +Editor PoC +========== + + +.. image:: ../img/TWP10_001.jpeg + :height: 14.925cm + :width: 9.258cm + :align: center + :alt: + + +.. toctree:: + :caption: Contenido + :maxdepth: 1 + :numbered: + + TWP67_1_en.rst \ No newline at end of file diff --git a/_sources/lectures/TWP67/toctree_en.rst b/_sources/lectures/TWP67/toctree_en.rst new file mode 100644 index 0000000000..5dddc02da3 --- /dev/null +++ b/_sources/lectures/TWP67/toctree_en.rst @@ -0,0 +1,18 @@ +========== +Editor PoC +========== + + +.. image:: ../img/TWP10_001.jpeg + :height: 14.925cm + :width: 9.258cm + :align: center + :alt: + + +.. toctree:: + :caption: Contenido + :maxdepth: 1 + :numbered: + + TWP67_1_en.rst \ No newline at end of file diff --git a/_sources/lectures/_static/index1.html b/_sources/lectures/_static/index1.html new file mode 100644 index 0000000000..7597eec547 --- /dev/null +++ b/_sources/lectures/_static/index1.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + diff --git a/_sources/lectures/_static/mini-coi.js b/_sources/lectures/_static/mini-coi.js new file mode 100644 index 0000000000..5ee52f2973 --- /dev/null +++ b/_sources/lectures/_static/mini-coi.js @@ -0,0 +1,28 @@ +/*! coi-serviceworker v0.1.7 - Guido Zuidhof and contributors, licensed under MIT */ +/*! mini-coi - Andrea Giammarchi and contributors, licensed under MIT */ +(({ document: d, navigator: { serviceWorker: s } }) => { + if (d) { + const { currentScript: c } = d; + s.register(c.src, { scope: c.getAttribute('scope') || '.' }).then(r => { + r.addEventListener('updatefound', () => location.reload()); + if (r.active && !s.controller) location.reload(); + }); + } + else { + addEventListener('install', () => skipWaiting()); + addEventListener('activate', e => e.waitUntil(clients.claim())); + addEventListener('fetch', e => { + const { request: r } = e; + if (r.cache === 'only-if-cached' && r.mode !== 'same-origin') return; + e.respondWith(fetch(r).then(r => { + const { body, status, statusText } = r; + if (!status || status > 399) return r; + const h = new Headers(r.headers); + h.set('Cross-Origin-Opener-Policy', 'same-origin'); + h.set('Cross-Origin-Embedder-Policy', 'require-corp'); + h.set('Cross-Origin-Resource-Policy', 'cross-origin'); + return new Response(body, { status, statusText, headers: h }); + })); + }); + } +})(self); \ No newline at end of file diff --git a/pyscript.html b/pyscript.html new file mode 100644 index 0000000000..c6aca41c4e --- /dev/null +++ b/pyscript.html @@ -0,0 +1,80 @@ + + + + + + Refresh Iframe + + + +
+ +
+ +
+ + +
+ +