diff --git a/.github/workflows/publish-book.yml b/.github/workflows/publish-book.yml index 8bb071726..ca87b0c30 100644 --- a/.github/workflows/publish-book.yml +++ b/.github/workflows/publish-book.yml @@ -1,36 +1,37 @@ name: Deploy book on: push: - tags: - - '*-?v[0-9]+*' + paths: ["docs/book/**"] + branches: + - main jobs: deploy: runs-on: ubuntu-latest permissions: - contents: write # To push a branch - pull-requests: write # To create a PR from that branch + contents: write # To push a branch + pull-requests: write # To create a PR from that branch steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Install mdbook - run: | - mkdir mdbook - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook - echo `pwd`/mdbook >> $GITHUB_PATH - - name: Deploy GitHub Pages - run: | - cd docs/book - mdbook build - git worktree add gh-pages - git config user.name "Deploy book from CI" - git config user.email "" - cd gh-pages - # Delete the ref to avoid keeping history. - git update-ref -d refs/heads/gh-pages - rm -rf * - mv ../book/* . - git add . - git commit -m "Deploy book $GITHUB_SHA to gh-pages" - git push --force --set-upstream origin gh-pages + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install mdbook + run: | + mkdir mdbook + curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook + echo `pwd`/mdbook >> $GITHUB_PATH + - name: Deploy GitHub Pages + run: | + cd docs/book + mdbook build + git worktree add gh-pages + git config user.name "Deploy book from CI" + git config user.email "" + cd gh-pages + # Delete the ref to avoid keeping history. + git update-ref -d refs/heads/gh-pages + rm -rf * + mv ../book/* . + git add . + git commit -m "Deploy book $GITHUB_SHA to gh-pages" + git push --force --set-upstream origin gh-pages diff --git a/docs/book/src/01_introduction.md b/docs/book/src/01_introduction.md index ce09ef4b1..1d46673aa 100644 --- a/docs/book/src/01_introduction.md +++ b/docs/book/src/01_introduction.md @@ -1,20 +1,22 @@ # Introduction -This book is intended as an introduction to the [Leptos](https://github.com/leptos-rs/leptos) Web framework. -It will walk through the fundamental concepts you need to build applications, +This book is intended as an introduction to the [Leptos](https://github.com/leptos-rs/leptos) Web framework. +It will walk through the fundamental concepts you need to build applications, beginning with a simple application rendered in the browser, and building toward a full-stack application with server-side rendering and hydration. -The guide doesn’t assume you know anything about fine-grained reactivity or the -details of modern Web frameworks. It does assume you are familiar with the Rust +The guide doesn’t assume you know anything about fine-grained reactivity or the +details of modern Web frameworks. It does assume you are familiar with the Rust programming language, HTML, CSS, and the DOM and basic Web APIs. -Leptos is most similar to frameworks like [Solid](https://www.solidjs.com) (JavaScript) -and [Sycamore](https://sycamore-rs.netlify.app/) (Rust). There are some similarities -to other frameworks like React (JavaScript), Svelte (JavaScript), Yew (Rust), and -Dioxus (Rust), so knowledge of one of those frameworks may also make it easier to +Leptos is most similar to frameworks like [Solid](https://www.solidjs.com) (JavaScript) +and [Sycamore](https://sycamore-rs.netlify.app/) (Rust). There are some similarities +to other frameworks like React (JavaScript), Svelte (JavaScript), Yew (Rust), and +Dioxus (Rust), so knowledge of one of those frameworks may also make it easier to understand Leptos. You can find more detailed docs for each part of the API at [Docs.rs](https://docs.rs/leptos/latest/leptos/). +**Important Note**: This current version of the book reflects the upcoming `0.5.0` release, which you can install as version `0.5.0-rc1`. The CodeSandbox versions of the examples still reflect `0.4` and earlier APIs and are in the process of being updated. + > The source code for the book is available [here](https://github.com/leptos-rs/leptos/tree/main/docs/book). PRs for typos or clarification are always welcome. diff --git a/docs/book/src/02_getting_started.md b/docs/book/src/02_getting_started.md index bed798ad8..50ab6c26f 100644 --- a/docs/book/src/02_getting_started.md +++ b/docs/book/src/02_getting_started.md @@ -23,13 +23,15 @@ cargo init leptos-tutorial `cd` into your new `leptos-tutorial` project and add `leptos` as a dependency ```bash -cargo add leptos --features=csr,nightly +cargo add leptos@0.5.0-rc1 --features=csr,nightly ``` +> **Note**: This version of the book reflects the upcoming Leptos 0.5.0 release. The CodeSandbox examples have not yet been updated from 0.4 and earlier versions. + Or you can leave off `nightly` if you're using stable Rust ```bash -cargo add leptos --features=csr +cargo add leptos@0.5.0-rc1 --features=csr ``` > Using `nightly` Rust, and the `nightly` feature in Leptos enables the function-call syntax for signal getters and setters that is used in most of this book.