Skip to content

fix(docs): function typos #2

fix(docs): function typos

fix(docs): function typos #2

Workflow file for this run

name: Web Demo Update
on:
push:
branches:
- main
jobs:
release-web:
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: install wasm-bindgen
uses: jetli/[email protected]
with:
version: 'latest'
- name: build (wasm)
run: cargo build --example simple --release --target wasm32-unknown-unknown
- name: package wasm
run: |
mkdir public
wasm-bindgen --target web --out-dir public target/wasm32-unknown-unknown/release/examples/simple.wasm --no-typescript
cat << EOF > public/index.html
<html>
<title>Replace HTML Demo</title>
<meta content=no-cache http-equiv=Cache-control>
<meta content=-1 http-equiv=Expires>
<script>let wasmModule;</script>
<script type="module">
import initSync from "/replace_html/simple.js";
wasmModule = await initSync(`/replace_html/simple_bg.wasm`);
</script>
<link as=fetch crossorigin href=/replace_html/simple_bg.wasm rel=preload type=application/wasm>
<link crossorigin href=/replace_html/simple.js rel=modulepreload>
</head>
<body>
This application needs JavaScript and WebAssembly to run.
</body>
</html>
EOF
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './public'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4