From f92c4c5526c254b26e65f5a8086471ff7ecc18bf Mon Sep 17 00:00:00 2001 From: woxtu Date: Thu, 5 May 2022 21:40:00 +0900 Subject: [PATCH 1/4] Add type annotations --- pyscriptjs/src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyscriptjs/src/utils.ts b/pyscriptjs/src/utils.ts index 4f23e332..71262595 100644 --- a/pyscriptjs/src/utils.ts +++ b/pyscriptjs/src/utils.ts @@ -4,11 +4,11 @@ function addClasses(element: HTMLElement, classes: Array) { } } -const getLastPath = function (str) { +function getLastPath(str: string): string { return str.split('\\').pop().split('/').pop(); -}; +} -function htmlDecode(input) { +function htmlDecode(input: string): string { const doc = new DOMParser().parseFromString(ltrim(input), 'text/html'); return doc.documentElement.textContent; } From b88c5664dc9433fb7cb2e7abc2a860bca45ae94e Mon Sep 17 00:00:00 2001 From: Bikarna Pokharel <15520600+bikarnap@users.noreply.github.com> Date: Thu, 5 May 2022 21:02:02 +0300 Subject: [PATCH 2/4] Add punctuation marks (#222) --- GETTING-STARTED.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GETTING-STARTED.md b/GETTING-STARTED.md index cbdeeec0..be47ce12 100644 --- a/GETTING-STARTED.md +++ b/GETTING-STARTED.md @@ -7,7 +7,7 @@ This page will guide you through getting started with PyScript. PyScript does not require any development environment other than a web browser. We recommend using Chrome. -If you're using [VSCode](https://code.visualstudio.com/) the +If you're using [VSCode](https://code.visualstudio.com/), the [Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) can be used to reload the page as you edit the HTML file. @@ -16,16 +16,16 @@ can be used to reload the page as you edit the HTML file. There is no installation required. In this document we'll use the PyScript assets served on https://pyscript.net. -If you want to download the source and build it yourself follow +If you want to download the source and build it yourself, follow the instructions in the README.md file. ## Your first PyScript HTML file -Here's a "Hello, world!" example using PyScript +Here's a "Hello, world!" example using PyScript. Using your favorite editor create a new file called `hello.html` in -the same directory as your PyScript JavaScript and CSS files with the -following content and open the file in your web browser. You can typically +the same directory as your PyScript, JavaScript, and CSS files with the +following content, and open the file in your web browser. You can typically open an HTML by double clicking it in your file explorer. ```html @@ -124,7 +124,7 @@ HTML head. You can also link to `.whl` files directly on disk like in our [toga ``` -If your `.whl` is not a pure Python wheel then open a PR or issue with [pyodide](https://github.com/pyodide/pyodide) to get it added here https://github.com/pyodide/pyodide/tree/main/packages. If there's enough popular demand the pyodide team will likely work on supporting your package, regardless things will likely move faster if you make the PR and consult with the team to get unblocked. +If your `.whl` is not a pure Python wheel, then open a PR or issue with [pyodide](https://github.com/pyodide/pyodide) to get it added here https://github.com/pyodide/pyodide/tree/main/packages. If there's enough popular demand, the pyodide team will likely work on supporting your package, regardless things will likely move faster if you make the PR and consult with the team to get unblocked. For example, NumPy and Matplotlib are available. Notice here we're using `` as a shortcut, which takes the expression on the last line of the script and runs `pyscript.write('plot', fig)`. From 7c85e8165955af0d42d02fca0d1674fe40a20f50 Mon Sep 17 00:00:00 2001 From: Ukeje Chukwuemeriwo Goodness Date: Thu, 5 May 2022 19:02:47 +0100 Subject: [PATCH 3/4] Changed tl; dr to summary (#216) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e5ecd9b..62c0b1e9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## What is PyScript -### tl;dr +### Summary PyScript is a Pythonic alternative to Scratch, JSFiddle or other "easy to use" programming frameworks, making the web a friendly, hackable, place where anyone can author interesting and interactive applications. To get started see [GETTING-STARTED](GETTING-STARTED.md). From 53044cbfdc71de3df665036883bf809d2021b41a Mon Sep 17 00:00:00 2001 From: Ukeje Chukwuemeriwo Goodness Date: Thu, 5 May 2022 19:08:25 +0100 Subject: [PATCH 4/4] Added Chrome links and embedded Pyodide (#215) I added a link to help users download chrome browser. I added the pyodide link the right way for readability. Co-authored-by: Peter W <34256109+pww217@users.noreply.github.com> --- GETTING-STARTED.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GETTING-STARTED.md b/GETTING-STARTED.md index be47ce12..d43e5521 100644 --- a/GETTING-STARTED.md +++ b/GETTING-STARTED.md @@ -5,7 +5,7 @@ This page will guide you through getting started with PyScript. ## Development setup PyScript does not require any development environment other -than a web browser. We recommend using Chrome. +than a web browser. We recommend using [Chrome](https://www.google.com/chrome/). If you're using [VSCode](https://code.visualstudio.com/), the [Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) @@ -124,7 +124,8 @@ HTML head. You can also link to `.whl` files directly on disk like in our [toga ``` -If your `.whl` is not a pure Python wheel, then open a PR or issue with [pyodide](https://github.com/pyodide/pyodide) to get it added here https://github.com/pyodide/pyodide/tree/main/packages. If there's enough popular demand, the pyodide team will likely work on supporting your package, regardless things will likely move faster if you make the PR and consult with the team to get unblocked. +If your `.whl` is not a pure Python wheel, then open a PR or issue with [pyodide](https://github.com/pyodide/pyodide) to get it added [here](https://github.com/pyodide/pyodide/tree/main/packages). +If there's enough popular demand the pyodide team will likely work on supporting your package, regardless things will likely move faster if you make the PR and consult with the team to get unblocked. For example, NumPy and Matplotlib are available. Notice here we're using `` as a shortcut, which takes the expression on the last line of the script and runs `pyscript.write('plot', fig)`.