Skip to content

Commit

Permalink
Final post-release clean-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Dec 8, 2023
1 parent e0a0071 commit e75c01b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/beginning-pyscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ level.

You can see this application embedded into the page below:

<iframe src="https://ntoll.pyscriptapps.com/piratical/v3" style="border: 1px solid black; width:100%;min-height: 400px; border-radius: 0.2rem; box-shadow: var(--md-shadow-z1);"></iframe>
<iframe src="https://ntoll.pyscriptapps.com/piratical/v4/" style="border: 1px solid black; width:100%;min-height: 400px; border-radius: 0.2rem; box-shadow: var(--md-shadow-z1);"></iframe>

Let's explore each of the three files that make this app work.

Expand Down
11 changes: 6 additions & 5 deletions docs/user-guide/builtins.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ use of inline event handlers via custom HTML attributes.
of why this is currently considered bad practice.

These attributes are expressed as `py-*` attributes of an HTML element that
reference the name of a Python function to run when the event is fired. The
`*` is replaced by the name of event, in a similar fashion to how all
reference the name of a Python function to run when the event is fired. You
should replace the `*` with the _actual name of an event_ (e.g. `py-click`).
This is similar to how all
[event handlers on elements](https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers-on-elements,-document-objects,-and-window-objects)
start with `on` (e.g. `onclick`) in standard HTML. The rule of thumb is to
start with `on` in standard HTML (e.g. `onclick`). The rule of thumb is to
simply replace `on` with `py-` and then reference the name of a Python
function.

Expand Down Expand Up @@ -210,5 +211,5 @@ enable this behaviour.
manipulation of the attribute's value could have resulted in the evaluation
of arbitrary code.

This is why we changed to the current behaviour of just supplying the name
of the Python function to be evaluated.
This is why we changed to the current behaviour: just supply the name
of the Python function to be evaluated, and PyScript will do this safely.
4 changes: 2 additions & 2 deletions docs/user-guide/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ The outcome of these code fragments should look something like this:

Hovering over the Python editor reveals the "run" button.

Finally, it is possible to specify a target node into which the output from
`print` statements is directed:
Finally, the `target` attribute allows you to specify a node into which the
editor will be rendered:

```html title="Specify a target for the Python editor."
<script type="mpy-editor" target="editor">
Expand Down
21 changes: 20 additions & 1 deletion docs/user-guide/examples.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Example applications

** TODO: fill this with references and descriptions to examples on PyScript.com **
A curated list of example applications that demonstrate various features of
PyScript can be found [on PyScript.com](https://pyscript.com/@examples).

The examples are (links take you to the code):

* [Hello world](https://pyscript.com/@examples/hello-world/latest)
* [A simple clock](https://pyscript.com/@examples/simple-clock/latest)
* [Simple slider panel](https://pyscript.com/@examples/simple-panel/latest)
* [Streaming data panel](https://pyscript.com/@examples/streaming-in-panel/latest)
* [WebGL Icosahedron](https://pyscript.com/@examples/webgl-icosahedron/latest)
* [KMeans in a panel](https://pyscript.com/@examples/kmeans-in-panel/latest)
* [New York Taxi panel (WebGL)](https://pyscript.com/@examples/nyc-taxi-panel-deckgl/latest)
* [Pandas dataframe fun](https://pyscript.com/@examples/pandas/latest)
* [Matplotlib example](https://pyscript.com/@examples/matplotlib/latest)
* [Numpy fractals](https://pyscript.com/@examples/fractals-with-numpy-and-canvas/latest)
* [Folium geographical data](https://pyscript.com/@examples/folium/latest)
* [Bokeh data plotting](https://pyscript.com/@examples/bokeh/latest)
* [Import antigravity](https://pyscript.com/@examples/antigravity/latest)
* [Altair data plotting](https://pyscript.com/@examples/altair/latest)

0 comments on commit e75c01b

Please sign in to comment.