8000 add components description in getting started (#417) · yannickfunk/pyscript@9119939 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9119939

Browse files
fpligeridanenglanderpre-commit-ci[bot]
authored
add components description in getting started (pyscript#417)
* add missing tags in getting started * add py-config tag to getting started * Edits to Fabio's tags/definitions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update getting-started.md Co-authored-by: Idan <ienglander@anaconda.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: idanenglander <60263976+idanenglander@users.noreply.github.com>
1 parent 59fc667 commit 9119939

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

docs/tutorials/getting-started.md

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,44 @@ fig
211211

212212
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.
213213

214-
## Visual components
214+
## The py-config tag
215215

216-
The following tags control visual attributes of your HTML page.
216+
Use the `<py-config>` tag to set and configure general metadata about your PyScript application in YAML format. If you are unfamiliar with YAML, consider reading [Red Hat's YAML for beginners](https://www.redhat.com/sysadmin/yaml-beginners) guide for more information.
217+
218+
The `<py-config>` tag can be used as follows:
219+
220+
```
221+
<py-config>
222+
- autoclose_loader: false
223+
- runtimes:
224+
-
225+
src: "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js"
226+
name: pyodide-0.20
227+
lang: python
228+
</py-config>
229+
```
230+
231+
The following optional values are supported by `<py-config>`:
232+
233+
* autoclose_loader (boolean): If false, PyScript will not close the loading splash screen when the startup operations finish.
234+
* name (string): Name of the user application. This field can be any string and is to be used by the application author for their own customization purposes.
235+
* version (string): Version of the user application. This field can be any string and is to be used by the application author for their own customization purposes. It is not related to the PyScript version.
236+
* runtimes (List of Runtimes): List of runtime configurations. Each Runtime expects the following fields:
237+
* src (string, Required): URL to the runtime source.
238+
* name (string): Name of the runtime. This field can be any string and is to be used by the application author for their own customization purposes.
239+
* name (string): Programming language supported by the runtime. This field can by used by the application author to provide clarify. It currently has no implications on how PyScript behaves.
240+
241+
## Visual component tags
242+
243+
The following tags can be used to add visual attributes to your HTML page.
217244

218245
| Tag | Description |
219246
| --- | ----------- |
220-
| `<py-inputbox>` | TBD |
221-
| `<py-box>` | TBD |
222-
| `<py-button>` | TBD |
223-
| `<py-list>` | TBD |
224-
| `<py-title>` | TBD |
247+
| `<py-inputbox>` | Adds an input box that can be used to prompt users to enter input values. |
248+
| `<py-box>` | Creates a container object that can be used to host one or more visual components that define how elements of `<py-box>` should align and show on the page. |
249+
| `<py-button>` | Adds a button to which authors can add labels and event handlers for actions on the button, such as `on_focus` or `on_click`. |
250+
| `<py-title>` | Adds a static text title component that styles the text inside the tag as a page title. |
251+
252+
```{note}
253+
All the elements above are experimental and not implemented at their full functionality. Use them with the understanding that the APIs or full support might change or be removed until the visual components are more mature.
254+
```

0 commit comments

Comments
 (0)
0