From cb4827059fdb34fa9b0cea714fb81b28741a08e7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Nov 2019 09:41:04 +0100 Subject: Add `README` for each subcrate --- web/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 web/README.md (limited to 'web/README.md') diff --git a/web/README.md b/web/README.md new file mode 100644 index 00000000..f86b2cb7 --- /dev/null +++ b/web/README.md @@ -0,0 +1,15 @@ +# `iced_web` +[![Documentation](https://docs.rs/iced_web/badge.svg)][documentation] +[![Crates.io](https://img.shields.io/crates/v/iced_web.svg)](https://crates.io/crates/iced_web) +[![License](https://img.shields.io/crates/l/iced_web.svg)](https://github.com/hecrj/iced/blob/master/LICENSE) +[![project chat](https://img.shields.io/badge/chat-on_zulip-brightgreen.svg)](https://iced.zulipchat.com) + +`iced_web` takes [`iced_core`] and builds a WebAssembly runtime on top. It achieves this by introducing a `Widget` trait that can be used to produce VDOM nodes. + +The crate is currently a __very experimental__, simple abstraction layer over [`dodrio`]. + +![iced_core](../docs/graphs/web.png) + +[documentation]: https://docs.rs/iced_web +[`iced_core`]: ../core +[`dodrio`]: https://github.com/fitzgen/dodrio -- cgit From 4b94cf00351f09fa916ebb1d89e4cdf4622fd800 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Nov 2019 09:56:16 +0100 Subject: Add installation section to subcrate `README`s --- web/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'web/README.md') diff --git a/web/README.md b/web/README.md index f86b2cb7..8f97f79e 100644 --- a/web/README.md +++ b/web/README.md @@ -13,3 +13,15 @@ The crate is currently a __very experimental__, simple abstraction layer over [` [documentation]: https://docs.rs/iced_web [`iced_core`]: ../core [`dodrio`]: https://github.com/fitzgen/dodrio + +## Installation +Add `iced_web` as a dependency in your `Cargo.toml`: + +```toml +iced_web = "0.1.0-alpha" +``` + +__Iced moves fast and the `master` branch can contain breaking changes!__ If +you want to learn about a specific release, check out [the release list]. + +[the release list]: https://github.com/hecrj/iced/releases -- cgit From 409b2db994980879355dc8ce0d065500a545ca61 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Nov 2019 10:54:32 +0100 Subject: Add usage section to `iced_web` --- web/README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'web/README.md') diff --git a/web/README.md b/web/README.md index 8f97f79e..762f6c83 100644 --- a/web/README.md +++ b/web/README.md @@ -25,3 +25,41 @@ __Iced moves fast and the `master` branch can contain breaking changes!__ If you want to learn about a specific release, check out [the release list]. [the release list]: https://github.com/hecrj/iced/releases + +## Usage +The current build process is a bit involved, as [`wasm-pack`] does not currently [support building binary crates](https://github.com/rustwasm/wasm-pack/issues/734). + +Therefore, we instead build using the `wasm32-unknown-unknown` target and use the [`wasm-bindgen`] CLI to generate appropriate bindings. + +For instance, let's say we want to build the [`tour` example]: + +``` +cd examples +cargo build --example tour --target wasm32-unknown-unknown +wasm-bindgen ../target/wasm32-unknown-unknown/debug/examples/tour.wasm --out-dir tour --web +``` + +Then, we need to create an `.html` file to load our application: + +```html + + + + + Tour - Iced + + + + + +``` + +Finally, we serve it using an HTTP server and access it with our browser. + +[`wasm-pack`]: https://github.com/rustwasm/wasm-pack +[`wasm-bindgen`]: https://github.com/rustwasm/wasm-bindgen +[`tour` example]: ../examples/README.md#tour -- cgit