Skip to content

Commit d192c52

Browse files
committed
add wasm demo
all credit goes to @JasperDeSutter rust-lang/rust-analyzer#1746
1 parent f35e3eb commit d192c52

17 files changed

+8288
-2
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ dist: xenial
33
language: ruby
44
cache: bundler
55

6-
script:
7-
- bundle exec jekyll build
6+
script: ./build.sh
87

98
deploy:
109
provider: pages

_config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ description: "rust-analyzer: building a better Rust IDE"
33
baseurl: ""
44
url: "https://rust-analyzer.github.io/"
55
github_username: rust-analyzer
6+
exclude:
7+
- wasm-demo

build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
curl https://sh.rustup.rs -sSf | sh -s -- -y
5+
export PATH="$HOME/.cargo/bin:$PATH"
6+
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
7+
8+
wasm-pack build ./wasm-demo
9+
pushd wasm-demo/www && npm install && npm run build && popd
10+
mv wasm-demo/www/dist/{*.js,*.wasm} ./
11+
bundle exec jekyll build

index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ <h2>Installation</h2>
3535
alternative installation methods and support for other editors.
3636
</p>
3737

38+
<p>
39+
Limited <a href="/wasm-demo.html"> WASM Demo</a>.
40+
Note: large download.
41+
</p>
3842
</section>
3943

4044
<section class="support">

wasm-demo.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Rust Analyzer</title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="/app.bundle.js"></script></body>
9+
</html>

wasm-demo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target

0 commit comments

Comments
 (0)