cargo html
create self-contained HTML programs
Want to run basic console programs in the browser? Too lazy to configure CORS properly to fetch/share WASM? Hate firing up a webserver when you'd rather just double click an HTML file? Easily confused by advanced concepts such as "I have multiple files"?
cargo html
solves all of this, by generating .html files which embed and encode their javascript, WASM, and WASI implementations directly into said HTML. No CORS, no --allow-file-access-from-files
flags, no sidecar files, 100% self contained.
# install
# create a project
# build a project
# view/run said project in the browser
rust-mini-games
- as mentioned on HN: https://news.ycombinator.com/item?id=26089539
- upstream: https://github.com/Syn-Nine/rust-mini-games
- patches: https://github.com/MaulingMonkey/rust-mini-games
Game | Issues |
---|---|
asylum | |
guess | |
knights | #6 File I/O not implemented (panic on exit) |
lord | #7 Colors not supported (some terminal escape garbage) |
rps | |
tictactoe |
To reproduce the gh-pages
of my fork of that repository from scratch:
# init
# build
# create branch
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.