diff --git a/docs/reference/elements/py-repl.md b/docs/reference/elements/py-repl.md index 244211e5..32d95021 100644 --- a/docs/reference/elements/py-repl.md +++ b/docs/reference/elements/py-repl.md @@ -4,12 +4,13 @@ The `` element provides a REPL(Read Eval Print Loop) to evaluate multi- ## Attributes -| attribute | type | default | description | -|-------------------|---------|---------|---------------------------------------| +| attribute | type | default | description | +|-------------------|---------|---------|--------------------------------------| | **auto-generate** | boolean | | Auto-generates REPL after evaluation | | **output-mode** | string | "" | Determines whether the output element is cleared prior to writing output | -| **output** | string | | The id of the element to write `stdout` and `stderr` to | +| **output** | string | | The id of the element to write `stdout` and `stderr` to | | **stderr** | string | | The id of the element to write `stderr` to | +| **src** | string | | Resource to be preloaded into the REPL | ### `auto-generate` @@ -24,6 +25,9 @@ The ID of an element in the DOM that `stdout` (e.g. `print()`), `stderr`, and th ### `stderr` The ID of an element in the DOM that `stderr` will be written to. Defaults to None, though writes to `stderr` will still appear in the location specified by `output`. +### `src` +If a \ tag has the `src` attribute, during page initialization, resource in the `src` will be preloaded into the REPL. Please note that this will not run in advance. If there is content in the \ tag, it will be cleared and replaced with preloaded resource. + ## Examples ### `` element set to auto-generate @@ -46,3 +50,13 @@ The following will write "Hello! World!" to the div with id `replOutput`. ``` Note that if we `print` from the REPL (or otherwise write to `sys.stdout`), the output will be printed in the [`py-terminal`](../plugins/py-terminal.md) if is enabled. + +### `` element with src +Preload resource from src into the REPL +```html + + If a py-repl tag has the src attribute, + the content here will be cleared and replaced. + +
+```