From 653ca851ae3d12611dac40dcca252f4b4d8ca75b Mon Sep 17 00:00:00 2001 From: Ryan Russell Date: Tue, 20 Sep 2022 04:45:27 -0500 Subject: [PATCH] docs(examples/core): readability improvements (#191) Signed-off-by: Ryan Russell Signed-off-by: Ryan Russell --- examples/core/basic/tests/main.rs | 2 +- examples/core/idb_freezing/README.md | 2 +- examples/core/js_interop/tests/main.rs | 2 +- examples/core/plugins/tests/main.rs | 2 +- examples/core/state_generation/src/templates/build_paths.rs | 2 +- .../src/templates/incremental_generation.rs | 2 +- .../core/state_generation/src/templates/revalidation.rs | 6 +++--- .../templates/revalidation_and_incremental_generation.rs | 6 +++--- examples/core/static_content/README.md | 2 +- examples/core/unreactive/tests/main.rs | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/core/basic/tests/main.rs b/examples/core/basic/tests/main.rs index 0a7b441c9b..4b1547313a 100644 --- a/examples/core/basic/tests/main.rs +++ b/examples/core/basic/tests/main.rs @@ -13,7 +13,7 @@ async fn main(c: &mut Client) -> Result<(), fantoccini::error::CmdError> { wait_for_checkpoint!("page_interactive", 0, c); let greeting = c.find(Locator::Css("p")).await?.text().await?; assert_eq!(greeting, "Hello World!"); - // For some reason, retrieving the inner HTML or text of a `` doens't + // For some reason, retrieving the inner HTML or text of a `<title>` doesn't // work let title = c.find(Locator::Css("title")).await?.html(false).await?; assert!(title.contains("Index Page")); diff --git a/examples/core/idb_freezing/README.md b/examples/core/idb_freezing/README.md index cbebd520aa..30ff57dba7 100644 --- a/examples/core/idb_freezing/README.md +++ b/examples/core/idb_freezing/README.md @@ -1,5 +1,5 @@ # IndexedDB Freezing Example -This example shows how Perseus can supprot freezing state to IndexedDB and retrieving it from there later, which is the mechanism of state freezing that many apps will use. This is also the basis of Perseus' HSR system. +This example shows how Perseus can support freezing state to IndexedDB and retrieving it from there later, which is the mechanism of state freezing that many apps will use. This is also the basis of Perseus' HSR system. Notably, this requires the `wasm-bindgen-futures` package and the `idb-freezing` feature enabled on the `perseus` package. diff --git a/examples/core/js_interop/tests/main.rs b/examples/core/js_interop/tests/main.rs index 0a7b441c9b..4b1547313a 100644 --- a/examples/core/js_interop/tests/main.rs +++ b/examples/core/js_interop/tests/main.rs @@ -13,7 +13,7 @@ async fn main(c: &mut Client) -> Result<(), fantoccini::error::CmdError> { wait_for_checkpoint!("page_interactive", 0, c); let greeting = c.find(Locator::Css("p")).await?.text().await?; assert_eq!(greeting, "Hello World!"); - // For some reason, retrieving the inner HTML or text of a `<title>` doens't + // For some reason, retrieving the inner HTML or text of a `<title>` doesn't // work let title = c.find(Locator::Css("title")).await?.html(false).await?; assert!(title.contains("Index Page")); diff --git a/examples/core/plugins/tests/main.rs b/examples/core/plugins/tests/main.rs index 9e49770237..96a4e665a5 100644 --- a/examples/core/plugins/tests/main.rs +++ b/examples/core/plugins/tests/main.rs @@ -15,7 +15,7 @@ async fn main(c: &mut Client) -> Result<(), fantoccini::error::CmdError> { wait_for_checkpoint!("page_interactive", 0, c); let greeting = c.find(Locator::Css("p")).await?.text().await?; assert_eq!(greeting, "Hello World!"); - // For some reason, retrieving the inner HTML or text of a `<title>` doens't + // For some reason, retrieving the inner HTML or text of a `<title>` doesn't // work let title = c.find(Locator::Css("title")).await?.html(false).await?; assert!(title.contains("Index Page")); diff --git a/examples/core/state_generation/src/templates/build_paths.rs b/examples/core/state_generation/src/templates/build_paths.rs index e66449c1f1..763cb9ff1a 100644 --- a/examples/core/state_generation/src/templates/build_paths.rs +++ b/examples/core/state_generation/src/templates/build_paths.rs @@ -29,7 +29,7 @@ pub fn get_template<G: Html>() -> Template<G> { } // We'll take in the path here, which will consist of the template name -// `build_paths` followed by the spcific path we're building for (as exported +// `build_paths` followed by the specific path we're building for (as exported // from `get_build_paths`) #[perseus::build_state] pub async fn get_build_state(path: String, _locale: String) -> RenderFnResultWithCause<PageState> { diff --git a/examples/core/state_generation/src/templates/incremental_generation.rs b/examples/core/state_generation/src/templates/incremental_generation.rs index ee71c934dd..19426c68ae 100644 --- a/examples/core/state_generation/src/templates/incremental_generation.rs +++ b/examples/core/state_generation/src/templates/incremental_generation.rs @@ -37,7 +37,7 @@ pub fn get_template<G: Html>() -> Template<G> { } // We'll take in the path here, which will consist of the template name -// `incremental_generation` followed by the spcific path we're building for (as +// `incremental_generation` followed by the specific path we're building for (as // exported from `get_build_paths`) #[perseus::build_state] pub async fn get_build_state(path: String, _locale: String) -> RenderFnResultWithCause<PageState> { diff --git a/examples/core/state_generation/src/templates/revalidation.rs b/examples/core/state_generation/src/templates/revalidation.rs index 9f6593e135..c9e313af4c 100644 --- a/examples/core/state_generation/src/templates/revalidation.rs +++ b/examples/core/state_generation/src/templates/revalidation.rs @@ -19,9 +19,9 @@ pub fn get_template<G: Html>() -> Template<G> { // This page will revalidate every five seconds (and so the time displayed will be updated) .revalidate_after("5s") // This is an alternative method of revalidation that uses logic, which will be executed - // every itme a user tries to load this page. For that reason, this should NOT do + // every time a user tries to load this page. For that reason, this should NOT do // long-running work, as requests will be delayed. If both this - // and `revaldiate_after()` are provided, this logic will only run when `revalidate_after()` + // and `revalidate_after()` are provided, this logic will only run when `revalidate_after()` // tells Perseus that it should revalidate. .should_revalidate_fn(should_revalidate) .build_state_fn(get_build_state) @@ -45,6 +45,6 @@ pub async fn should_revalidate( _req: perseus::Request, ) -> RenderFnResultWithCause<bool> { // For simplicity's sake, this will always say we should revalidate, but you - // could amke this check any condition + // could make this check any condition Ok(true) } diff --git a/examples/core/state_generation/src/templates/revalidation_and_incremental_generation.rs b/examples/core/state_generation/src/templates/revalidation_and_incremental_generation.rs index 1d8ceebd9f..07b8bdd599 100644 --- a/examples/core/state_generation/src/templates/revalidation_and_incremental_generation.rs +++ b/examples/core/state_generation/src/templates/revalidation_and_incremental_generation.rs @@ -26,9 +26,9 @@ pub fn get_template<G: Html>() -> Template<G> { // This page will revalidate every five seconds (and so the time displayed will be updated) .revalidate_after(Duration::new(5, 0)) // This is an alternative method of revalidation that uses logic, which will be executed - // every itme a user tries to load this page. For that reason, this should NOT do + // every time a user tries to load this page. For that reason, this should NOT do // long-running work, as requests will be delayed. If both this - // and `revaldiate_after()` are provided, this logic will only run when `revalidate_after()` + // and `revalidate_after()` are provided, this logic will only run when `revalidate_after()` // tells Perseus that it should revalidate. .should_revalidate_fn(should_revalidate) .build_state_fn(get_build_state) @@ -61,6 +61,6 @@ pub async fn should_revalidate( _req: perseus::Request, ) -> RenderFnResultWithCause<bool> { // For simplicity's sake, this will always say we should revalidate, but you - // could amke this check any condition + // could make this check any condition Ok(true) } diff --git a/examples/core/static_content/README.md b/examples/core/static_content/README.md index 23a80db985..1b9d4e7884 100644 --- a/examples/core/static_content/README.md +++ b/examples/core/static_content/README.md @@ -1,3 +1,3 @@ # Static Content Example -This example doesn't introduce any new code, it just shows how to host arbitrary static content with Perseus. By default, any content in the `static/` directory at the root of your project will be hosted at the URL `/.perseus/static/`, though you can also add aliases to content inside your project's root directory to be hsoted at any URL in your app. This example shows both methods, and you'll be able to find a file at `/test.txt` and at `/.perseus/static/style.css` (named so as to indicate that you would typically put stylesheets in the `static/` directory). +This example doesn't introduce any new code, it just shows how to host arbitrary static content with Perseus. By default, any content in the `static/` directory at the root of your project will be hosted at the URL `/.perseus/static/`, though you can also add aliases to content inside your project's root directory to be hosted at any URL in your app. This example shows both methods, and you'll be able to find a file at `/test.txt` and at `/.perseus/static/style.css` (named so as to indicate that you would typically put stylesheets in the `static/` directory). diff --git a/examples/core/unreactive/tests/main.rs b/examples/core/unreactive/tests/main.rs index bbed6e1bd5..7b2d67894f 100644 --- a/examples/core/unreactive/tests/main.rs +++ b/examples/core/unreactive/tests/main.rs @@ -13,7 +13,7 @@ async fn main(c: &mut Client) -> Result<(), fantoccini::error::CmdError> { wait_for_checkpoint!("page_interactive", 0, c); let greeting = c.find(Locator::Css("p")).await?.text().await?; assert_eq!(greeting, "Hello World!"); - // For some reason, retrieving the inner HTML or text of a `<title>` doens't + // For some reason, retrieving the inner HTML or text of a `<title>` doesn't // work let title = c.find(Locator::Css("title")).await?.html(false).await?; assert!(title.contains("Index Page"));