Skip to content

Commit

Permalink
Create a more visual home page for demo gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwillchen committed Jun 10, 2024
1 parent 50cd862 commit e814b8c
Show file tree
Hide file tree
Showing 73 changed files with 298 additions and 42 deletions.
7 changes: 7 additions & 0 deletions demo/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ package(
py_library(
name = "demo",
srcs = glob(["*.py"]),
data = [":screenshots"],
deps = [
"//mesop",
"//mesop/labs",
],
)

# Make source files available for distribution via pkg_npm
filegroup(
name = "screenshots",
srcs = glob(["screenshots/*"]),
)
13 changes: 13 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@ $ gcloud run deploy mesop --source .
```

See our Mesop deployment [docs](https://google.github.io/mesop/guides/deployment/#deploy-to-google-cloud-run) for more background.

## Generate screenshots

If you add more demos and want to re-generate screenshots, do the following steps:

1. in `demo/screenshot.ts` change `test.skip` to `test`
1. Run: `yarn playwright test demo/screenshot.ts`
1. Install cwebp using `brew install webp` or download from [here](https://developers.google.com/speed/webp/docs/precompiled).
1. From the workspace root, run:

```sh
`for file in demo/screenshots/*; do cwebp -q 50 "$file" -o "${file%.*}.webp"; done`
```
Loading

0 comments on commit e814b8c

Please sign in to comment.