diff --git a/part_2_subscribe_form/README.md b/part_2_subscribe_form/README.md index f510af7..cce4cbc 100644 --- a/part_2_subscribe_form/README.md +++ b/part_2_subscribe_form/README.md @@ -4,7 +4,7 @@ ### Introduction -In the first part of the tutorial series we created a basic web server and wrote our first Scuttlebutt-related code. This tutorial installment will add an HTML form and route handler(s) to allow peer subscriptions through the web interface. We will learn how to validate public keys submitted via the form and how to check whether or not we already follow the peer represented by a submitted key. These additions will pave the way for following and unfollowing peers. +In the first part of the tutorial series we created a basic web server and wrote our first Scuttlebutt-related code. This tutorial installment will add an HTML form and route handler(s) to allow peer subscriptions through the web interface. We will learn how to validate public keys submitted via the form and how to check whether or not we follow the peer represented by a submitted key. These additions will pave the way for following and unfollowing peers. There's a lot of ground to cover today. Let's dive into it. @@ -88,7 +88,7 @@ async fn rocket() -> _ { ### Add Peer Subscription Form and Routes -Now that we've taken care of some housekeeping, we can begin adding new functionality. We need a way to accept a public key; this will allow us to subscribe and unsubscribe to the posts of selected peer. We'll use the Tera templating engine to create HTML templates for our application. Tera is inspired by the Jinja2 template language and is supported by Rocket. +Now that we've taken care of some housekeeping, we can begin adding new functionality. We need a way to accept a public key; this will allow us to subscribe and unsubscribe to the posts of a particular peer. We'll use the [Tera templating engine](https://tera.netlify.app/) to create HTML templates for our application. Tera is inspired by the [Jinja2 template language](https://jinja.palletsprojects.com/en/3.0.x/) and is supported by [Rocket](https://rocket.rs/). The Tera functionality we require is bundled in the `rocket_dyn_templates` crate. We can add that to our manifest: @@ -96,7 +96,7 @@ The Tera functionality we require is bundled in the `rocket_dyn_templates` crate `rocket_dyn_templates = { version = "0.1.0-rc.1", features = ["tera"] }` -We also need to modify the Rocket launch code in `src/main.rs` to attach a template fairing: +We will modify the Rocket launch code in `src/main.rs` to attach a template fairing. Fairings are Rocket's approach to structured middleware: ```rust use rocket_dyn_templates::Template; @@ -129,13 +129,13 @@ For now we'll write some HTML boilerplate code and a form to accept a public key
{{ whoami }}
- +{{ whoami }}
+