Rename `docs/` to `web_demo/`

This commit is contained in:
Emil Ernerfeldt 2023-11-16 16:44:30 +01:00
parent 8723c5a4d3
commit 94edb9d5e0
14 changed files with 17 additions and 1777 deletions

View File

@ -7,4 +7,4 @@ nknown = "nknown" # part of @55nknown username
Prefence = "Prefence" # typo in glutin_winit API
[files]
extend-exclude = ["docs/egui_demo_app.js"] # auto-generated
extend-exclude = ["web_demo/egui_demo_app.js"] # auto-generated

View File

@ -1,3 +0,0 @@
This folder contains the files required for the egui web demo hosted at <https://www.egui.rs/>.
The reason the folder is called "docs" is because that is the name that GitHub requires in order to host a web page from the `master` branch of a repository.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -68,7 +68,7 @@ else
FEATURES="${FEATURES},glow"
fi
FINAL_WASM_PATH=docs/${OUT_FILE_NAME}_bg.wasm
FINAL_WASM_PATH=web_demo/${OUT_FILE_NAME}_bg.wasm
# Clear output from old stuff:
rm -f "${FINAL_WASM_PATH}"
@ -91,7 +91,7 @@ TARGET="target"
echo "Generating JS bindings for wasm…"
TARGET_NAME="${CRATE_NAME}.wasm"
WASM_PATH="${TARGET}/wasm32-unknown-unknown/$BUILD/$TARGET_NAME"
wasm-bindgen "${WASM_PATH}" --out-dir docs --out-name ${OUT_FILE_NAME} --no-modules --no-typescript
wasm-bindgen "${WASM_PATH}" --out-dir web_demo --out-name ${OUT_FILE_NAME} --no-modules --no-typescript
# if this fails with "error: cannot import from modules (`env`) with `--no-modules`", you can use:
# wasm2wat target/wasm32-unknown-unknown/release/egui_demo_app.wasm | rg env

View File

@ -14,5 +14,5 @@ cargo install basic-http-server
echo "starting server…"
echo "serving at http://localhost:${PORT}"
(cd docs && basic-http-server --addr 0.0.0.0:${PORT} .)
# (cd docs && python3 -m http.server ${PORT} --bind 0.0.0.0)
(cd web_demo && basic-http-server --addr 0.0.0.0:${PORT} .)
# (cd web_demo && python3 -m http.server ${PORT} --bind 0.0.0.0)

View File

@ -3,4 +3,4 @@ set -eu
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path"
./build_demo_web.sh && ls -lh ../docs/*.wasm
./build_demo_web.sh && ls -lh ../web_demo/*.wasm

2
web_demo/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
egui_demo_app_bg.wasm
egui_demo_app.js

9
web_demo/README.md Normal file
View File

@ -0,0 +1,9 @@
This folder contains the files required for the egui web demo hosted at <https://www.egui.rs/>.
## Testing locally
* Build with `scripts/build_demo_web.sh`
* Host with `scripts/start_server.sh`
* Open <http://localhost:8888/index.html>
## Deploying egui.rs
Each merge into `master` will trigger a new deploy

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB