From 4471cbbcc1b25c1a0f2e7477d6918b3081402577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Wed, 20 Mar 2024 04:14:58 +0100 Subject: [PATCH] Make "The Runtime" example interactive with `mdbook-iced` :tada: --- .github/workflows/publish.yml | 9 +++++---- .gitignore | 2 ++ book.toml | 3 +++ src/the-runtime.md | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 66fd3cd..93e47c6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,10 +10,11 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }} steps: - uses: actions/checkout@v2 - - name: Install mdBook - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: 'latest' + - uses: hecrj/setup-rust-action@v2 + - name: Install `mdbook`, `mdbook-iced`, and `wasm-bindgen-cli` + run: cargo install mdbook mdbook-iced wasm-bindgen-cli + - name: Add `wasm32-unknown-unknown` target to Rust toolchain + run: rustup target add wasm32-unknown-unknown - name: Build book run: mdbook build - name: Copy CNAME diff --git a/.gitignore b/.gitignore index 7585238..02b1974 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ book +target +.icebergs diff --git a/book.toml b/book.toml index 6b7bc2c..80b2f57 100644 --- a/book.toml +++ b/book.toml @@ -12,3 +12,6 @@ edit-url-template = "https://github.com/iced-rs/book/edit/master/{path}" [output.html.playground] runnable = false + +[preprocessor.iced] +rev = "9db6ac8f202ebdc1453edee01da0b30aee0949d8" diff --git a/src/the-runtime.md b/src/the-runtime.md index 1d39e88..236d61a 100644 --- a/src/the-runtime.md +++ b/src/the-runtime.md @@ -214,7 +214,7 @@ its own magic[^magic]—so you don't need to worry about learning the dark arts If we want to run our `Counter`, all we have to do is call [`run`]: -```rust,ignore +```rust,ignore,iced(height=100px) # use iced::widget::{button, column, text, Column}; # pub fn main() -> iced::Result {