Tool for converting Html to Rust for use with the Seed web framework Seed can be used to build web applications in WebAssembly inspired by Elm.
Use html-to-seed to:
- converting an existing HTML UI to a Seed based application.
- check your UI layout in Html before committing to building an application, then generate the view code with little to no effort.
Try it here.
- html-to-seed-web - The tool as a webassembly SPA (single page application).
- html-to-seed-bin - Command line version of the tool.
- html-to-seed-lib - The library that does the actual conversions.
- html-to-seed is inspired by html-to-elmish for F#/Fable by Maxime Mangel.
- Some Html samples were borrowed from html-to-elmish.
- Icons from Zondicons by Steve Schoger.
- You need to install Rust, NodeJs and NPM.
- Ensure you have WASM support enabled using
$ rustup target add wasm32-unknown-unknown
- Trunkrs is is required to build the SPA:
- trunkrs install:
$ cargo install trunkrs
- trunkrs install:
- Clone or download this repo.
- Install TailwindCSS using
cd html-to-seed-web
&npm ci
-
cargo build
andcargo build --release
- Build the library and cli tool and output to
/target
.
- Build the library and cli tool and output to
cargo test
- Run the unit tests for the library.
From within the html-to-seed-web directory
trunk serve
- Build project and start developer server on
127.0.0.1:8080
. - Server auto-reloads browser on changes.
- Build project and start developer server on
-
trunk build --release
- Build project and output artifacts ready to deploy to
../dist
directory.
- Build project and output artifacts ready to deploy to
Should work with most modern browsers. Guaranteed not to work in IE.
- create Issue or PR.
- Ideas, bugs, questions, ... - create Issue.
Note: Please squash commits and rebase before creating PR. Thanks!