You will need the following tooling installed:
rustup
which call gives you cargo/rustc- The
wasm32-unknown-unknown
target which you can install withrustup target add wasm32-unknown-unknown
wasm-tools
which you can install withcargo install wasm-tools
First, build the wasm module:
cargo build --target wasm32-unknown-unknown --release -p markdown
The convert it into a component:
wasm-tools component new ./target/wasm32-unknown-unknown/release/markdown.wasm -o markdown-component.wasm
Then run the demo:
cargo run markdown-component.wasm
Thank you to everyone who is working on WebAssembly tooling.
Additionally, this is based on the following work: