diff --git a/.github/workflows/typo.yml b/.github/workflows/typo.yml new file mode 100644 index 000000000..4994dd768 --- /dev/null +++ b/.github/workflows/typo.yml @@ -0,0 +1,42 @@ +# Whenever an open PR is updated, the workflow will be triggered + +name: Language Linting + +on: + push: + branches: + - main + + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + branches: + - main + +jobs: + typos: + if: github.event.pull_request.draft == false + name: Check for typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check for typos + uses: crate-ci/typos@master + + # Check for invalid links in the repository + link-check: + if: github.event.pull_request.draft == false + name: Check For Invalid Links + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Restore lychee cache + uses: actions/cache@v4 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + - name: Run lychee + uses: lycheeverse/lychee-action@v2 + with: + args: --base . --config ./lychee.toml './**/*.md' + fail: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1ccfab805..3f1b71cdb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ !.vscode/launch.json !.vscode/extensions.json +.lycheecache + .idea /pkg diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 000000000..feb213b3c --- /dev/null +++ b/_typos.toml @@ -0,0 +1,10 @@ +[default.extend-words] +# https://ratatui.rs/ +ratatui = "ratatui" +# lits is short for literals +lits = "lits" +# https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/seeked_event +seeked = "seeked" + +[files] +extend-exclude = ["translations/*", "CHANGELOG.md", "*.js"] \ No newline at end of file diff --git a/docs-src/0.4/en/reference/use_future.md b/docs-src/0.4/en/reference/use_future.md index 7d6e6934e..92f802371 100644 --- a/docs-src/0.4/en/reference/use_future.md +++ b/docs-src/0.4/en/reference/use_future.md @@ -34,5 +34,5 @@ The `UseFuture` handle provides a `restart` method. It can be used to execute th Often, you will need to run the future again every time some value (e.g. a prop) changes. Rather than calling `restart` manually, you can provide a tuple of "dependencies" to the hook. It will automatically re-run the future when any of those dependencies change. Example: ```rust, no_run -{{#include src/doc_examples/untested_04/use_future.rs:dependancy}} +{{#include src/doc_examples/untested_04/use_future.rs:dependency}} ``` diff --git a/docs-src/0.6/src/cookbook/testing.md b/docs-src/0.6/src/cookbook/testing.md index a52a49d39..c36f7eabb 100644 --- a/docs-src/0.6/src/cookbook/testing.md +++ b/docs-src/0.6/src/cookbook/testing.md @@ -41,6 +41,6 @@ webServer: [ ], ``` -- [Web example](https://github.com/DioxusLabs/dioxus/tree/main/playwright-tests/web) -- [Liveview example](https://github.com/DioxusLabs/dioxus/tree/main/playwright-tests/liveview) -- [Fullstack example](https://github.com/DioxusLabs/dioxus/tree/main/playwright-tests/fullstack) +- [Web example](https://github.com/DioxusLabs/dioxus/tree/main/packages/playwright-tests/web) +- [Liveview example](https://github.com/DioxusLabs/dioxus/tree/main/packages/playwright-tests/liveview) +- [Fullstack example](https://github.com/DioxusLabs/dioxus/tree/main/packages/playwright-tests/fullstack) diff --git a/docs-src/0.6/src/guides/fullstack/index.md b/docs-src/0.6/src/guides/fullstack/index.md index 786e75b54..f64bc7732 100644 --- a/docs-src/0.6/src/guides/fullstack/index.md +++ b/docs-src/0.6/src/guides/fullstack/index.md @@ -8,4 +8,4 @@ Dioxus Fullstack contains helpers for: This guide will teach you everything you need to know about how to use the utilities in Dioxus fullstack to create amazing fullstack applications. -> In addition to this guide, you can find more examples of full-stack apps and information about how to integrate with other frameworks and desktop renderers in the [dioxus-fullstack examples directory](https://github.com/DioxusLabs/dioxus/tree/main/packages/fullstack/examples). +> In addition to this guide, you can find more examples of full-stack apps and information about how to integrate with other frameworks and desktop renderers in the [dioxus example directory](https://github.com/DioxusLabs/dioxus/tree/main/examples). diff --git a/docs-src/0.6/src/guides/fullstack/server_functions.md b/docs-src/0.6/src/guides/fullstack/server_functions.md index df90079a6..fc9c7daaa 100644 --- a/docs-src/0.6/src/guides/fullstack/server_functions.md +++ b/docs-src/0.6/src/guides/fullstack/server_functions.md @@ -62,7 +62,7 @@ SandBoxFrame { ## Running the client with dioxus-desktop -The project presented so far makes a web browser interact with the server, but it is also possible to make a desktop program interact with the server in a similar fashion. (The full example code is available in the [Dioxus repo](https://github.com/DioxusLabs/dioxus/tree/main/packages/fullstack/examples/axum-desktop)) +The project presented so far makes a web browser interact with the server, but it is also possible to make a desktop program interact with the server in a similar fashion. (The full example code is available in the [Dioxus repo](https://github.com/DioxusLabs/dioxus/tree/main/examples/fullstack-desktop)) First, we need to make two binary targets, one for the desktop program (the `client.rs` file), one for the server (the `server.rs` file). The client app and the server functions are written in a shared `lib.rs` file. diff --git a/docs-src/0.6/src/guides/web/index.md b/docs-src/0.6/src/guides/web/index.md index eb4a7270f..67ade667d 100644 --- a/docs-src/0.6/src/guides/web/index.md +++ b/docs-src/0.6/src/guides/web/index.md @@ -35,4 +35,4 @@ If you are targeting web, but don't plan on targeting any other Dioxus renderer ## Customizing Index Template Dioxus supports providing custom index.html templates. The index.html must include a `div` with the id `main` to be used. Hot Reload is still supported. An example -is provided in the [PWA-Example](https://github.com/DioxusLabs/dioxus/blob/main/examples/PWA-example/index.html). +is provided in the [PWA-Example](https://github.com/DioxusLabs/dioxus/blob/main/examples/pwa/index.html). diff --git a/docs-src/0.6/src/router/example/first-route.md b/docs-src/0.6/src/router/example/first-route.md index 52b69d813..a0f9a91f4 100644 --- a/docs-src/0.6/src/router/example/first-route.md +++ b/docs-src/0.6/src/router/example/first-route.md @@ -73,4 +73,4 @@ handle when a route doesn't exist. Next, we'll create the blog portion of our site. We will utilize nested routes and URL parameters. [`Router`]: https://docs.rs/dioxus-router/latest/dioxus_router/components/fn.Router.html -[`Routable`]: https://docs.rs/dioxus-router/latest/dioxus_router/components/fn.Routable.html +[`Routable`]: https://docs.rs/dioxus-router/latest/dioxus_router/routable/trait.Routable.html diff --git a/docs-src/0.6/src/router/example/redirection-perfection.md b/docs-src/0.6/src/router/example/redirection-perfection.md index 49b072349..51bfeb188 100644 --- a/docs-src/0.6/src/router/example/redirection-perfection.md +++ b/docs-src/0.6/src/router/example/redirection-perfection.md @@ -28,7 +28,7 @@ That's it! Now your users will be redirected to the blog. Well done! You've completed the Dioxus Router guide. You've built a small application and learned about the many things you can do with Dioxus Router. -To continue your journey, you attempt a challenge listed below, look at the [router examples](https://github.com/DioxusLabs/dioxus/tree/main/packages/router/examples), or +To continue your journey, you attempt a challenge listed below, look at the [examples](https://github.com/DioxusLabs/dioxus/tree/main/examples), or the [API reference](https://docs.rs/dioxus-router/). ### Challenges diff --git a/docs-src/0.6/src/router/reference/static-generation.md b/docs-src/0.6/src/router/reference/static-generation.md index f2c5891cf..b6d50224b 100644 --- a/docs-src/0.6/src/router/reference/static-generation.md +++ b/docs-src/0.6/src/router/reference/static-generation.md @@ -18,4 +18,4 @@ To statically render pages, we need to flatten the route tree and generate a fil - [examples/static-hydrated](https://github.com/DioxusLabs/dioxus/tree/v0.5/packages/fullstack/examples/static-hydrated) -[`Routable`]: https://docs.rs/dioxus-router/latest/dioxus_router/components/fn.Routable.html +[`Routable`]: https://docs.rs/dioxus-router/latest/dioxus_router/routable/trait.Routable.html diff --git a/docs-src/blog/src/introducing-dioxus.md b/docs-src/blog/src/introducing-dioxus.md index 179866b3e..5ec6b3052 100644 --- a/docs-src/blog/src/introducing-dioxus.md +++ b/docs-src/blog/src/introducing-dioxus.md @@ -174,7 +174,7 @@ $ cargo init dioxus_example $ cd dioxus_example ``` -We then add a dependancy on Dioxus to the `Cargo.toml` file, with the "desktop" feature enabled: +We then add a dependency on Dioxus to the `Cargo.toml` file, with the "desktop" feature enabled: ```rust [dependencies] diff --git a/docs-src/blog/src/release-020.md b/docs-src/blog/src/release-020.md index 0ecaa05bc..c88c064cd 100644 --- a/docs-src/blog/src/release-020.md +++ b/docs-src/blog/src/release-020.md @@ -313,7 +313,7 @@ A ton more! Dioxus is now much more stable than it was at release! * [Home automation server app](https://github.com/FruitieX/homectl) [@FruitieX](https://github.com/FruitieX) * [Video Recording app](https://github.com/rustkid/recorder) * [Music streaming app](https://github.com/autarch/Crumb/tree/master/web-frontend) [@autarch](https://github.com/autarch) -* [NixOS dependancy installation](https://gist.github.com/FruitieX/73afe3eb15da45e0e05d5c9cf5d318fc) [@FruitieX](https://github.com/FruitieX) +* [NixOS dependency installation](https://gist.github.com/FruitieX/73afe3eb15da45e0e05d5c9cf5d318fc) [@FruitieX](https://github.com/FruitieX) * [Vercel Deploy Template](https://github.com/lucifer1004/dioxus-vercel-demo) [@lucifer1004](https://github.com/lucifer1004) * [Render Katex in Dioxus](https://github.com/oovm/katex-wasm) * [Render PrismJS in Dioxus](https://github.com/oovm/prism-wasm) diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 000000000..16e5666ba --- /dev/null +++ b/lychee.toml @@ -0,0 +1,18 @@ +# This is the configuration file for lychee, a link validator. +exclude = [ + 'file:///', + 'https://github.com/DioxusLabs/dioxus/commit', + 'mysql.com', + 'azure.microsoft.com' +] +exclude_path = [ + 'target', + 'docs-src/0.3', + 'docs-src/0.4', + 'docs-src/0.5', + 'docs-src/blog' +] +exclude_all_private = true +no_progress = false +cache = true +max_cache_age = "10d" diff --git a/src/doc_examples/untested_03/conditional_rendering.rs b/src/doc_examples/untested_03/conditional_rendering.rs index c6095df98..dc407898b 100644 --- a/src/doc_examples/untested_03/conditional_rendering.rs +++ b/src/doc_examples/untested_03/conditional_rendering.rs @@ -9,11 +9,13 @@ fn main() { pub fn App(cx: Scope) -> Element { let is_logged_in = use_state(cx, || false); - cx.render(rsx!(LogIn { - is_logged_in: **is_logged_in, - on_log_in: |_| is_logged_in.set(true), - on_log_out: |_| is_logged_in.set(false), - })) + cx.render(rsx!( + LogIn { + is_logged_in: **is_logged_in, + on_log_in: |_| is_logged_in.set(true), + on_log_out: |_| is_logged_in.set(false), + } + )) } #[inline_props] @@ -57,7 +59,7 @@ cx.render(rsx! { // We only render the welcome message if we are logged in // You can use if statements in the middle of a render block to conditionally render elements if *is_logged_in { - // Notice the body of this if statment is rsx code, not an expression + // Notice the body of this if statemenet is rsx code, not an expression "Welcome!" } button { diff --git a/src/doc_examples/untested_04/custom_renderer.rs b/src/doc_examples/untested_04/custom_renderer.rs index a0e359913..ebeb81b1d 100644 --- a/src/doc_examples/untested_04/custom_renderer.rs +++ b/src/doc_examples/untested_04/custom_renderer.rs @@ -33,9 +33,9 @@ impl State for Size { fn update<'a>( &mut self, node_view: NodeView<()>, - _node: ::ElementBorrowed<'a>, - _parent: Option<::ElementBorrowed<'a>>, - children: Vec<::ElementBorrowed<'a>>, + _node: ::ElementBorrowed<'a>, + _parent: Option<::ElementBorrowed<'a>>, + children: Vec<::ElementBorrowed<'a>>, context: &SendAnyMap, ) -> bool { let font_size = context.get::().unwrap().0; @@ -99,9 +99,9 @@ impl State for TextColor { fn update<'a>( &mut self, node_view: NodeView<()>, - _node: ::ElementBorrowed<'a>, - parent: Option<::ElementBorrowed<'a>>, - _children: Vec<::ElementBorrowed<'a>>, + _node: ::ElementBorrowed<'a>, + parent: Option<::ElementBorrowed<'a>>, + _children: Vec<::ElementBorrowed<'a>>, _context: &SendAnyMap, ) -> bool { // TextColor only depends on the color tag, so getting the first tag is equivalent to looking through all tags @@ -148,9 +148,9 @@ impl State for Border { fn update<'a>( &mut self, node_view: NodeView<()>, - _node: ::ElementBorrowed<'a>, - _parent: Option<::ElementBorrowed<'a>>, - _children: Vec<::ElementBorrowed<'a>>, + _node: ::ElementBorrowed<'a>, + _parent: Option<::ElementBorrowed<'a>>, + _children: Vec<::ElementBorrowed<'a>>, _context: &SendAnyMap, ) -> bool { // check if the node contains a border attribute @@ -271,11 +271,11 @@ impl State for MyState { // The view of the current node limited to the parts this state depends on _node_view: NodeView<()>, // The state of the current node that this state depends on - _node: ::ElementBorrowed<'a>, + _node: ::ElementBorrowed<'a>, // The state of the parent nodes that this state depends on - _parent: Option<::ElementBorrowed<'a>>, + _parent: Option<::ElementBorrowed<'a>>, // The state of the child nodes that this state depends on - _children: Vec<::ElementBorrowed<'a>>, + _children: Vec<::ElementBorrowed<'a>>, // The context of the current node used to pass global state into the tree _context: &SendAnyMap, ) -> bool { diff --git a/src/doc_examples/untested_04/use_future.rs b/src/doc_examples/untested_04/use_future.rs index 4631a24f5..5ac2fe143 100644 --- a/src/doc_examples/untested_04/use_future.rs +++ b/src/doc_examples/untested_04/use_future.rs @@ -42,7 +42,7 @@ pub fn App(cx: Scope) -> Element { #[component] fn RandomDog(cx: Scope, breed: String) -> Element { - // ANCHOR: dependancy + // ANCHOR: dependency let future = use_future(cx, (breed,), |(breed,)| async move { reqwest::get(format!("https://dog.ceo/api/breed/{breed}/images/random")) .await @@ -50,7 +50,7 @@ fn RandomDog(cx: Scope, breed: String) -> Element { .json::() .await }); - // ANCHOR_END: dependancy + // ANCHOR_END: dependency cx.render(rsx!(())) }