Skip to content

Commit

Permalink
docs: Update tutorials and installation instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci committed Jul 10, 2023
1 parent 1027547 commit 78ea150
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 309 deletions.
23 changes: 0 additions & 23 deletions website/docs/_start_q.md

This file was deleted.

211 changes: 0 additions & 211 deletions website/docs/installation-8-20.mdx

This file was deleted.

20 changes: 7 additions & 13 deletions website/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';


## Install

:::important
These instructions apply to v0.20 or later. For previous versions, [click here](/docs/installation-8-20).
:::

<Tabs groupId="pypi/conda">

<TabItem value="pip" label="Pip">
Expand All @@ -29,7 +23,7 @@ conda config --append channels conda-forge
conda install -c h2oai h2o-wave
```
:::info
Conda packaging does not contain Wave server which means, you will still need to run the wave server (waved) yourself. See how to run it [here](/docs/installation-8-20#setup).
Conda packaging does not contain Wave server which means, you will still need to run the wave server (waved) [separately](/docs/tutorial-hello#step-1-start-the-wave-server).
:::

</TabItem>
Expand All @@ -40,7 +34,7 @@ To install in a virtual environment (recommended):

<Tabs groupId="operating-systems">

<TabItem value="lin" label="Linux/MacOS">
<TabItem value="lin" label="Unix/MacOS">

```shell
python3 -m venv venv
Expand Down Expand Up @@ -71,7 +65,7 @@ conda install -c h2oai h2o-wave
```

:::info
Conda packaging does not contain Wave server which means, you will still need to run the wave server (waved) yourself. See how to run it [here](/docs/installation-8-20#setup).
Conda packaging does not contain Wave server which means, you will still need to run the wave server (waved) [separately](/docs/tutorial-hello#step-1-start-the-wave-server).
:::

</TabItem>
Expand Down Expand Up @@ -120,7 +114,7 @@ Automated test harness........ /home/wave/test
Wave daemon for deployments... /home/wave
```

You should now have access to 200+ examples locally.
You now have access to 200+ examples locally.

:::info
On recent versions of OSX, it's possible to run into certificate verification errors while running `wave fetch`, specifically `urllib.error.URLError: urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate`. To fix this problem, navigate to `Application/Python 3.7` on your system and execute `Install Certificates.command`.
Expand Down Expand Up @@ -150,11 +144,11 @@ To play with the tour's active example in isolation, simply open a new browser t

## Downloading Wave

If you would like to run Wave server manually (e.g. for [deployment](/docs/deployment)), you can download it either from here or from our [Github releases](https://github.com/h2oai/wave/releases).
If you would like to run Wave server manually (e.g. for [deployment](/docs/deployment) or [Wave scripts](/docs/scripts)), you can download it either from here or from our [Github releases](https://github.com/h2oai/wave/releases).

If you are unsure which package to pick, here is a helper table:
If unsure which package to pick, here is a helper table:

| **Your OS** | **Wave server** | **Python client** |
| **OS** | **Wave server** | **Python client** |
|:-----------:|:---------------:|:------------------:|
| Mac | darwin-amd64 | macosx_10_9_x86_64 |
| Mac M1 | darwin-arm64 | macosx_11_0_arm64 |
Expand Down
2 changes: 1 addition & 1 deletion website/docs/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ page['qux'] = ui.some_card()
page.save()
```

You can run it by using `python my_script.py` assuming your [Wave server](/docs/installation-8-20#step-4-run) is running.
You can run it by using `python my_script.py` assuming your [Wave server](/docs/tutorial-hello#step-1-start-the-wave-server) is running.

Here is the skeleton of a Wave script that continuously updates a page ([example](tutorial-monitor.md)):

Expand Down
9 changes: 4 additions & 5 deletions website/docs/tutorial-beer.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This tutorial assumes your Wave server is up and running, and you have a working

Our program looks like this. It's mostly similar to the one in the [Hello World tutorial](tutorial-hello.mdx), with one exception: we're setting the markdown card's content inside a `for` loop.

```py {13-18} title="$HOME/wave-apps/beer_wall.py"
```py {13-18} title="beer_wall.py"
import time
from h2o_wave import site, ui

Expand All @@ -53,8 +53,7 @@ Take one down, pass it around, {i - 1} bottles of beer on the wall...
## Step 2: Run your program

```shell
cd $HOME/wave-apps
./venv/bin/python beer_wall.py
python beer_wall.py
```

## Step 3: Watch updates live
Expand All @@ -67,7 +66,7 @@ Point your browser to [http://localhost:10101/beer](http://localhost:10101/beer)

Our program is accurate, but not necessarily efficient. Every second, it sends the entire verse in its entirety to the Wave server, with only minuscule changes (`i` and `i-1`). You can observe this in the Wave server's log (switch to the terminal window running the Wave server to view the log):

```
```sh
2020/10/02 12:13:43 * /beer {"d":[{"k":"wall content","v":"\n98 bottles of beer on the wall, 98 bottles of beer.\n\nTake one down, pass it around, 97 bottles of beer on the wall...\n"}]}
2020/10/02 12:13:44 * /beer {"d":[{"k":"wall content","v":"\n97 bottles of beer on the wall, 97 bottles of beer.\n\nTake one down, pass it around, 96 bottles of beer on the wall...\n"}]}
2020/10/02 12:13:46 * /beer {"d":[{"k":"wall content","v":"\n96 bottles of beer on the wall, 96 bottles of beer.\n\nTake one down, pass it around, 95 bottles of beer on the wall...\n"}]}
Expand Down Expand Up @@ -138,7 +137,7 @@ for i in range(99, 0, -1):

Run your program again. You should see the same results in your browser as before, but you'll notice that the information flowing through the Wave server is significantly less than before:

```
```sh
2020/10/02 13:53:11 * /beer {"d":[{"k":"wall data before","v":"98"},{"k":"wall data after","v":"97"}]}
2020/10/02 13:53:12 * /beer {"d":[{"k":"wall data before","v":"97"},{"k":"wall data after","v":"96"}]}
2020/10/02 13:53:13 * /beer {"d":[{"k":"wall data before","v":"96"},{"k":"wall data after","v":"95"}]}
Expand Down
Loading

0 comments on commit 78ea150

Please sign in to comment.