From 19dd55ec20abd3272f92a14003b6877cc7770b17 Mon Sep 17 00:00:00 2001 From: Daniel Sousa Date: Fri, 15 Sep 2023 20:07:02 +0100 Subject: [PATCH 1/3] Remove whitespace in website tutorial --- website/versioned_docs/version-0.20/tutorial/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-0.20/tutorial/index.mdx b/website/versioned_docs/version-0.20/tutorial/index.mdx index 1e8c398b7ef..83e70685449 100644 --- a/website/versioned_docs/version-0.20/tutorial/index.mdx +++ b/website/versioned_docs/version-0.20/tutorial/index.mdx @@ -107,7 +107,7 @@ Now, let's create an `index.html` at the root of the project. ```html title="index.html" - + ``` From ea3c1967b52e920074ca6392e7a316ad820e00e8 Mon Sep 17 00:00:00 2001 From: Daniel Sousa Date: Sun, 17 Sep 2023 15:12:26 +0100 Subject: [PATCH 2/3] Update index.mdx Remove whitespace in tutorial. --- website/docs/tutorial/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/tutorial/index.mdx b/website/docs/tutorial/index.mdx index 67146c3e2ad..9bf1c2c34bd 100644 --- a/website/docs/tutorial/index.mdx +++ b/website/docs/tutorial/index.mdx @@ -107,7 +107,7 @@ Now, let's create an `index.html` at the root of the project. ```html title="index.html" - + ``` From dc2c9143f3995b43f623abde08a9f5b4f4dad89b Mon Sep 17 00:00:00 2001 From: Daniel Sousa Date: Mon, 18 Sep 2023 21:20:24 +0000 Subject: [PATCH 3/3] Add more information to website. Changes to be committed: modified: website/docs/tutorial/index.mdx modified: website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx modified: website/versioned_docs/version-0.20/tutorial/index.mdx --- website/docs/tutorial/index.mdx | 18 +++++++++++++++--- .../getting-started/build-a-sample-app.mdx | 17 +++++++++++++++-- .../version-0.20/tutorial/index.mdx | 18 +++++++++++++++--- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/website/docs/tutorial/index.mdx b/website/docs/tutorial/index.mdx index 9bf1c2c34bd..9f1b4759c97 100644 --- a/website/docs/tutorial/index.mdx +++ b/website/docs/tutorial/index.mdx @@ -117,12 +117,24 @@ Now, let's create an `index.html` at the root of the project. Run the following command to build and serve the application locally. ```bash -trunk serve --open +trunk serve --open // remove option '--open' to not open your default browser ``` Trunk will open your application in your default browser, watch the project directory and helpfully rebuild your -application if you modify any source files. If you are curious, you can run `trunk help` and `trunk help ` -for more details on what is happening. +application if you modify any source files. +This will fail if the socket is being used by another application. +By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080). +To change it, create the following file and edit as needed: + +```toml title="Trunk.toml" +[serve] +# The address to serve on. +address = "127.0.0.1" // "0.0.0.0" for WAN +# The port to serve on. +port = 8000 +``` + +If you are curious, you can run `trunk help` and `trunk help ` for more details on what is happening. ### Congratulations diff --git a/website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx b/website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx index 996bd3f4a92..7db716c4a94 100644 --- a/website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx +++ b/website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx @@ -46,7 +46,7 @@ To convert this simple command line application to a basic Yew web application, #### Update Cargo.toml -Add `yew` to the list of dependencies. +Add `yew` to the list of dependencies editing file: ```toml title=Cargo.toml [package] @@ -58,6 +58,8 @@ edition = "2021" yew = { version = "0.20.0", features = ["csr"] } ``` +or using `cargo add yew -F csr`. + :::info You only need feature `csr` if you are building an application. @@ -128,10 +130,21 @@ Finally, add an `index.html` file in the root directory of your app. Run the following command to build and serve the application locally. ```bash -trunk serve +trunk serve // add option '--open' to open your default browser ``` Trunk will rebuild your application if you modify any of its source code files. +This will fail if the socket is being used by another application. +By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080). +To change it, create the following file and edit as needed: + +```toml title="Trunk.toml" +[serve] +# The address to serve on. +address = "127.0.0.1" // "0.0.0.0" for WAN +# The port to serve on. +port = 8000 +``` ## Congratulations diff --git a/website/versioned_docs/version-0.20/tutorial/index.mdx b/website/versioned_docs/version-0.20/tutorial/index.mdx index 83e70685449..da593f33c69 100644 --- a/website/versioned_docs/version-0.20/tutorial/index.mdx +++ b/website/versioned_docs/version-0.20/tutorial/index.mdx @@ -117,12 +117,24 @@ Now, let's create an `index.html` at the root of the project. Run the following command to build and serve the application locally. ```bash -trunk serve --open +trunk serve --open // remove option '--open' to not open your default browser ``` Trunk will open your application in your default browser, watch the project directory and helpfully rebuild your -application if you modify any source files. If you are curious, you can run `trunk help` and `trunk help ` -for more details on what's happening. +application if you modify any source files. +This will fail if the socket is being used by another application. +By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080). +To change it, create the following file and edit as needed: + +```toml title="Trunk.toml" +[serve] +# The address to serve on. +address = "127.0.0.1" // "0.0.0.0" for WAN +# The port to serve on. +port = 8000 +``` + +If you are curious, you can run `trunk help` and `trunk help ` for more details on what's happening. ### Congratulations