8000 Embedding video, adding PS tag definitions (#403) · yannickfunk/pyscript@0d946f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d946f8

Browse files
Embedding video, adding PS tag definitions (pyscript#403)
* Embedding video, adding PS tag definitions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * html -> HTML; add sphinxcontrib.youtube to env.yml * change place of sphinxcontrib.youtube in env.yml * one more sphinxcontrib-youtube change Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b767a78 commit 0d946f8

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

docs/concepts/what-is-pyscript.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ PyScript turns the browser into a code deployment tool that a 8000 nyone can learn to
99
In this example, we are using the `<py-script>` HTML tag to generate a Matplotlib figure and display it as an image.
1010
Click **Preview** to see the rendered HTML.
1111

12-
To try it in your browser, copy the HTML source to a new HTML file and double-click it to open.
12+
To try it in your browser, copy the code below into an online HTML editor like W3School's [Tryit Editor](https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default_default), which allows you to modify, run, and even save your code. Watch the video below to see it in action!
1313

14+
```{youtube} ZtC7TCt_LhU
15+
```
1416

1517
::::{tab-set}
1618
:::{tab-item} HTML Source

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"sphinx_togglebutton",
3636
"sphinx_sitemap",
3737
"sphinxemoji.sphinxemoji",
38+
"sphinxcontrib.youtube",
3839
]
3940

4041
# Add any paths that contain templates here, relative to this directory.

docs/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ dependencies:
1010
- sphinx-copybutton
1111
- sphinx-design
1212
- sphinx-togglebutton
13+
1314
- pip:
1415
- sphinxemoji
1516
- sphinx-sitemap
1617
- sphinx-autobuild
18+
- sphinxcontrib-youtube

docs/tutorials/getting-started.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ print(s)
7272

7373
### Writing into labeled elements
7474

75-
In the example above, we had a single `<py-script>` tag and it printed
75+
In the example above, we had a single `<py-script>` tag printing
7676
one or more lines onto the page in order. Within the `<py-script>`, you
7777
have access to the `pyscript` module, which provides a `.write()` method
7878
to send strings into labeled elements on the page.
7979

8080
For example, we'll add some style elements and provide place holders for
81-
the `<py-script>` tag write to.
81+
the `<py-script>` tag to write to.
8282

8383
```html
8484
<html>
@@ -109,12 +109,12 @@ pyscript.write('pi', f'π is approximately {pi:.3f}')
109109
</html>
110110
```
111111

112-
## Packages and modules
112+
## The py-env tag
113113

114114
In addition to the [Python Standard Library](https://docs.python.org/3/library/) and
115115
the `pyscript` module, many 3rd-party OSS packages will work out-of-the-box with PyScript.
116116

117-
In order to use them, you will need to declare the dependencies using the `<py-env>` in the
117+
In order to use them, you will need to declare the dependencies using the `<py-env>` tag in the
118118
HTML head. You can also link to `.whl` files directly on disk like in our [toga example](https://github.com/pyscript/pyscript/blob/main/pyscriptjs/examples/toga/freedom.html).
119119

120120
```
@@ -207,3 +207,18 @@ fig
207207
</body>
208208
</html>
209209
```
210+
## The py-repl tag
211+
212+
The `<py-repl>` tag creates a REPL component that is rendered to the page as a code editor, allowing you to write executable code inline.
213+
214+
## Visual components
215+
216+
The following tags control visual attributes of your HTML page.
217+
218+
| Tag | Description |
219+
| --- | ----------- |
220+
| `<py-inputbox>` | TBD |
221+
| `<py-box>` | TBD |
222+
| `<py-button>` | TBD |
223+
| `<py-list>` | TBD |
224+
| `<py-title>` | TBD |

0 commit comments

Comments
 (0)
0