From 20f4034c1c9c3148a2255c4aa25794eeee89555a Mon Sep 17 00:00:00 2001 From: Andrew Grande Date: Mon, 24 Jul 2023 04:25:02 -0700 Subject: [PATCH] docs: proofreading and fixing the links (#1425) * Update 23_ssr_modes.md Fixed grammar, added the section anchor links * Fixed a broken link The github link doesn't get properly rendered in the Leptos book site. Make the book work, 'break' the github link. * Update 26_extractors.md Fixed broken Axum links. Added an Axum extract function doc link for consistency (had Actix, but not Axum before) --- docs/book/src/server/25_server_functions.md | 2 +- docs/book/src/server/26_extractors.md | 6 +++--- docs/book/src/ssr/23_ssr_modes.md | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/book/src/server/25_server_functions.md b/docs/book/src/server/25_server_functions.md index 862c612535..da8ab140c4 100644 --- a/docs/book/src/server/25_server_functions.md +++ b/docs/book/src/server/25_server_functions.md @@ -113,7 +113,7 @@ Server functions are a cool technology, but it’s very important to remember. * So far, everything I’ve said is actually framework agnostic. (And in fact, the Leptos server function crate has been integrated into Dioxus as well!) Server functions are simply a way of defining a function-like RPC call that leans on Web standards like HTTP requests and URL encoding. -But in a way, they also provide the last missing primitive in our story so far. Because a server function is just a plain Rust async function, it integrates perfectly with the async Leptos primitives we discussed [earlier](../async/README.md). So you can easily integrate your server functions with the rest of your applications: +But in a way, they also provide the last missing primitive in our story so far. Because a server function is just a plain Rust async function, it integrates perfectly with the async Leptos primitives we discussed [earlier](https://leptos-rs.github.io/leptos/async/index.html). So you can easily integrate your server functions with the rest of your applications: - Create **resources** that call the server function to load data from the server - Read these resources under `` or `` to enable streaming SSR and fallback states while data loads. diff --git a/docs/book/src/server/26_extractors.md b/docs/book/src/server/26_extractors.md index dec744592f..49e055cce0 100644 --- a/docs/book/src/server/26_extractors.md +++ b/docs/book/src/server/26_extractors.md @@ -6,9 +6,9 @@ The server functions we looked at in the last chapter showed how to run code on We call Leptos a “full-stack” framework, but “full-stack” is always a misnomer (after all, it never means everything from the browser to your power company.) For us, “full stack” means that your Leptos app can run in the browser, and can run on the server, and can integrate the two, drawing together the unique features available in each; as we’ve seen in the book so far, a button click on the browser can drive a database read on the server, both written in the same Rust module. But Leptos itself doesn’t provide the server (or the database, or the operating system, or the firmware, or the electrical cables...) -Instead, Leptos provides integrations for the two most popular Rust web server frameworks, Actix Web ([`leptos_actix`](https://docs.rs/leptos_actix/latest/leptos_actix/)) and Axum ([`leptos_axum`](https://docs.rs/leptos_actix/latest/leptos_axum/)). We’ve built integrations with each server’s router so that you can simply plug your Leptos app into an existing server with `.leptos_routes()`, and easily handle server function calls. +Instead, Leptos provides integrations for the two most popular Rust web server frameworks, Actix Web ([`leptos_actix`](https://docs.rs/leptos_actix/latest/leptos_actix/)) and Axum ([`leptos_axum`](https://docs.rs/leptos_axum/latest/leptos_axum/)). We’ve built integrations with each server’s router so that you can simply plug your Leptos app into an existing server with `.leptos_routes()`, and easily handle server function calls. -> If haven’t seen our [Actix](https://github.com/leptos-rs/start) and [Axum](https://github.com/leptos-rs/start-axum) templates, now’s a good time to check them out. +> If you haven’t seen our [Actix](https://github.com/leptos-rs/start) and [Axum](https://github.com/leptos-rs/start-axum) templates, now’s a good time to check them out. ## Using Extractors @@ -43,7 +43,7 @@ pub async fn actix_extract(cx: Scope) -> Result { ## Axum Extractors -The syntax for the `leptos_axum::extract` function is very similar. (**Note**: This is available on the git main branch, but has not been released as of writing.) Note that Axum extractors return a `Result`, so you’ll need to add something to handle the error case. +The syntax for the [`leptos_axum::extract`](https://docs.rs/leptos_axum/latest/leptos_axum/fn.extract.html) function is very similar. (**Note**: This is available on the git main branch, but has not been released as of writing.) Note that Axum extractors return a `Result`, so you’ll need to add something to handle the error case. ```rust #[server(AxumExtract, "/api")] diff --git a/docs/book/src/ssr/23_ssr_modes.md b/docs/book/src/ssr/23_ssr_modes.md index 294a79edc9..29dae9f020 100644 --- a/docs/book/src/ssr/23_ssr_modes.md +++ b/docs/book/src/ssr/23_ssr_modes.md @@ -8,7 +8,12 @@ If you’ve ever listened to streaming music or watched a video online, I’m su Let me say a little more about what I mean. -Leptos supports all four different of these different ways to render HTML that includes asynchronous data. +Leptos supports all four different modes of rendering HTML that includes asynchronous data: + +1. [Synchronous Rendering](#synchronous-rendering) +1. [Async Rendering](#async-rendering) +1. [In-Order streaming](#in-order-streaming) +1. [Out-of-Order Streaming](#out-of-order-streaming) ## Synchronous Rendering