From 6586e79d5e162f8ce44f359c8d59f512db9fc231 Mon Sep 17 00:00:00 2001 From: Jason Washburn <35488541+jasonwashburn@users.noreply.github.com> Date: Wed, 23 Nov 2022 10:52:26 -0600 Subject: [PATCH] remove deprecated ref in getting started doc (#974) --- docs/tutorials/getting-started.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 9d81b7ef..9abce529 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -107,9 +107,10 @@ print back onto the page. For example, we can compute π. ### Writing into labeled elements In the example above, we had a single `` tag printing -one or more lines onto the page in order. Within the ``, you -have access to the `pyscript` module, which provides a `.write()` method -to send strings into labeled elements on the page. +one or more lines onto the page in order. Within the ``, you can +use the `Element` class to create a python object for interacting with +page elements. Objects created from the `Element` class provide the `.write()` method +which enables you to send strings into the page elements referenced by those objects. For example, we'll add some style elements and provide placeholders for the `` tag to write to. @@ -128,7 +129,7 @@ the `` tag to write to.
import datetime as dt - pyscript.write('today', dt.date.today().strftime('%A %B %d, %Y')) + Element('today').write(dt.date.today().strftime('%A %B %d, %Y')) def compute_pi(n): pi = 2 @@ -137,7 +138,7 @@ the `` tag to write to. return pi pi = compute_pi(100000) - pyscript.write('pi', f'π is approximately {pi:.3f}') + Element('pi').write(f'π is approximately {pi:.3f}')