-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathbuild_docs.bash
More file actions
executable file
·51 lines (38 loc) · 1.8 KB
/
build_docs.bash
File metadata and controls
executable file
·51 lines (38 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
set -e
echo "========================================="
echo "Step 1/7: Downloading LLVM..."
echo "========================================="
wget -qO- https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-Linux-X64.tar.xz | tar xJ
echo "========================================="
echo "Step 2/7: Installing Rust..."
echo "========================================="
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
echo "========================================="
echo "Step 3/7: Installing wasm-pack and nightly toolchain..."
echo "========================================="
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
rustup toolchain install nightly
echo "========================================="
echo "Step 4/7: Building WebAssembly playground..."
echo "========================================="
cd website_playground
RUSTUP_TOOLCHAIN="nightly" RUSTFLAGS="--cfg procmacro2_semver_exempt --cfg super_unstable" CC="$PWD/../LLVM-19.1.0-Linux-X64/bin/clang" wasm-pack build
cd ..
echo "========================================="
echo "Step 5/7: Building Rust documentation..."
echo "========================================="
RUSTUP_TOOLCHAIN="nightly" RUSTDOCFLAGS="--cfg docsrs -Dwarnings" cargo doc --no-deps --all-features
cp -r target/doc docs/static/rustdoc
cd docs
echo "========================================="
echo "Step 6/7: Installing npm dependencies..."
echo "========================================="
npm ci
echo "========================================="
echo "Step 7/7: Building Docusaurus site..."
echo "========================================="
LOAD_PLAYGROUND=1 npm run build
echo "========================================="
echo "Build complete!"
echo "========================================="