From ff7433f434e0af8a634373579e0f200f9c49d78d Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti <24919330+marcalexiei@users.noreply.github.com> Date: Wed, 29 Jan 2025 08:33:55 +0100 Subject: [PATCH] docs: use consistent snippet style across the codebase (#451) Co-authored-by: wd <52734504+wdcodecn@users.noreply.github.com> --- apps/documentation/README.md | 7 ------- apps/documentation/src/components/Hero/Hero.tsx | 2 +- .../documentation/src/routes/documentation/cli.mdx | 2 +- .../src/routes/documentation/components/link.mdx | 2 +- .../src/routes/documentation/installation.mdx | 6 +++--- .../documentation/routing/defining-routes.mdx | 2 +- .../routes/documentation/tutorial/api-fetching.mdx | 6 +++--- .../documentation/tutorial/development-setup.mdx | 14 +++++++------- .../documentation/tutorial/dynamic-routes.mdx | 2 +- .../src/routes/documentation/tutorial/index.mdx | 4 ++-- .../routes/documentation/tutorial/production.mdx | 8 ++++---- examples/README.md | 8 ++++---- examples/tuono-app/README.md | 4 ++-- examples/tuono-tutorial/README.md | 4 ++-- examples/with-mdx/README.md | 8 +++----- examples/with-tailwind/README.md | 4 ++-- 16 files changed, 37 insertions(+), 46 deletions(-) delete mode 100644 apps/documentation/README.md diff --git a/apps/documentation/README.md b/apps/documentation/README.md deleted file mode 100644 index 5ecd43ac..00000000 --- a/apps/documentation/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Tuono starter - -This is the starter tuono project. To download it run in your terminal: - -```shell -$ tuono new [NAME] -``` diff --git a/apps/documentation/src/components/Hero/Hero.tsx b/apps/documentation/src/components/Hero/Hero.tsx index 906b1d2e..f565a31c 100644 --- a/apps/documentation/src/components/Hero/Hero.tsx +++ b/apps/documentation/src/components/Hero/Hero.tsx @@ -36,7 +36,7 @@ export default function Hero(): JSX.Element { size="lg" style={{ border: 'solid 1px var(--mantine-color-violet-1)' }} color="gray" - leftSection="$ cargo install tuono" + leftSection="cargo install tuono" rightSection={ copied ? ( diff --git a/apps/documentation/src/routes/documentation/cli.mdx b/apps/documentation/src/routes/documentation/cli.mdx index 1dc86854..02c51bc6 100644 --- a/apps/documentation/src/routes/documentation/cli.mdx +++ b/apps/documentation/src/routes/documentation/cli.mdx @@ -19,7 +19,7 @@ Tuono is the CLI that provides all the needed commands to handle the full-stack To list all the available commands, run `tuono -h`. -```bash +```sh The React/Rust full-stack framework Usage: tuono diff --git a/apps/documentation/src/routes/documentation/components/link.mdx b/apps/documentation/src/routes/documentation/components/link.mdx index 2005ffef..1c27b2cb 100644 --- a/apps/documentation/src/routes/documentation/components/link.mdx +++ b/apps/documentation/src/routes/documentation/components/link.mdx @@ -13,7 +13,7 @@ import Breadcrumbs from '@/components/Breadcrumbs' Tuono provides a `Link` component for clientside navigation between pages of your app. `Link` prefetches pages from any links above the fold, allowing for faster navigations without a full reload. -```typescript jsx +```tsx import { Link } from 'tuono' export default function Page() { diff --git a/apps/documentation/src/routes/documentation/installation.mdx b/apps/documentation/src/routes/documentation/installation.mdx index 4a17e6a1..689b8532 100644 --- a/apps/documentation/src/routes/documentation/installation.mdx +++ b/apps/documentation/src/routes/documentation/installation.mdx @@ -28,19 +28,19 @@ languages. Since then, you need the following tools installed on your computer t The tuono `CLI` is hosted on [crates.io](https://crates.io/crates/tuono) to download and install it, just run it on a terminal: -```bash +```sh cargo install tuono ``` To check that it is correctly installed, run: -```bash +```sh tuono --version ``` Run `tuono -h` to see all the available commands. -```bash +```sh The React/Rust full-stack framework Usage: tuono diff --git a/apps/documentation/src/routes/documentation/routing/defining-routes.mdx b/apps/documentation/src/routes/documentation/routing/defining-routes.mdx index c79c68e9..5bb8fd4b 100644 --- a/apps/documentation/src/routes/documentation/routing/defining-routes.mdx +++ b/apps/documentation/src/routes/documentation/routing/defining-routes.mdx @@ -23,7 +23,7 @@ Every page is rendered server side by default. Example: If you create `src/routes/about.tsx` that exports a React component like: -``` +```tsx export default function About() { return
About
} diff --git a/apps/documentation/src/routes/documentation/tutorial/api-fetching.mdx b/apps/documentation/src/routes/documentation/tutorial/api-fetching.mdx index 208e25f5..808b9140 100644 --- a/apps/documentation/src/routes/documentation/tutorial/api-fetching.mdx +++ b/apps/documentation/src/routes/documentation/tutorial/api-fetching.mdx @@ -25,7 +25,7 @@ To start, let’s fetch all of them from the root page. Since we want to render Clear the `index.rs` file and paste: -```rust +```rs // src/routes/index.rs use serde::{Deserialize, Serialize}; use reqwest::Client; @@ -76,8 +76,8 @@ You can load them in the `ApplicationState` of your app inside the `./src/app.rs To install it just run in your terminal: -```bash -$ cargo add reqwest +```sh +cargo add reqwest ``` A new entry has just been added to your `Cargo.toml` file. diff --git a/apps/documentation/src/routes/documentation/tutorial/development-setup.mdx b/apps/documentation/src/routes/documentation/tutorial/development-setup.mdx index f87c020e..e0d62f4f 100644 --- a/apps/documentation/src/routes/documentation/tutorial/development-setup.mdx +++ b/apps/documentation/src/routes/documentation/tutorial/development-setup.mdx @@ -21,21 +21,21 @@ import Breadcrumbs from '@/components/Breadcrumbs' To set up a new fresh project you just need to run the following command: -``` -$ tuono new tuono-tutorial +```sh +tuono new tuono-tutorial ``` Get into the project folder and install the dependencies with: -``` -$ npm install +```sh +npm install ``` Open it with your favorite code editor. The project will have the following structure: -``` +```text ├── package.json ├── public ├── src @@ -58,8 +58,8 @@ CSS modules. To start the development environment, you just need to run the following command within the project folder: -``` -$ tuono dev +```sh +tuono dev ``` The first time might take a little bit because it will install all the Rust’s dependencies. All the other execution will be pretty quick! diff --git a/apps/documentation/src/routes/documentation/tutorial/dynamic-routes.mdx b/apps/documentation/src/routes/documentation/tutorial/dynamic-routes.mdx index 25931d1d..24036cf4 100644 --- a/apps/documentation/src/routes/documentation/tutorial/dynamic-routes.mdx +++ b/apps/documentation/src/routes/documentation/tutorial/dynamic-routes.mdx @@ -29,7 +29,7 @@ These two will handle every request that points to `http://localhost:3000/pokemo Let’s first work on the server side file. Paste into the new `[pokemon].rs` file the following code: -```rust +```rs // src/routes/pokemons/[pokemon].rs use serde::{Deserialize, Serialize}; use reqwest::Client; diff --git a/apps/documentation/src/routes/documentation/tutorial/index.mdx b/apps/documentation/src/routes/documentation/tutorial/index.mdx index 935d8ec3..411a699b 100644 --- a/apps/documentation/src/routes/documentation/tutorial/index.mdx +++ b/apps/documentation/src/routes/documentation/tutorial/index.mdx @@ -20,8 +20,8 @@ This tutorial is not meant for people who don't know React - in that case, I sug If you prefer to just read the code rather than write you can download the finished tutorial project with: -```bash -$ tuono new tutorial --template tuono-tutorial +```sh +tuono new tutorial --template tuono-tutorial ``` > I'd love to hear your thoughts about the framework and the tutorial - feel free to reach me at [valerioageno@yahoo.it](mailto:valerioageno@ahoo.it) diff --git a/apps/documentation/src/routes/documentation/tutorial/production.mdx b/apps/documentation/src/routes/documentation/tutorial/production.mdx index 95a68b98..62484d3a 100644 --- a/apps/documentation/src/routes/documentation/tutorial/production.mdx +++ b/apps/documentation/src/routes/documentation/tutorial/production.mdx @@ -20,15 +20,15 @@ import Breadcrumbs from '@/components/Breadcrumbs' The source is now ready to be released. Both server and client have been managed in an unoptimized way to ease the development experience. To build the project to the production state, just run: -```shell -$ tuono build +```sh +tuono build ``` This command just created the final assets within the `out` directory. To run the production server, run: -```shell -$ cargo run --release +```sh +cargo run --release ``` Check again [`http://localhost:3000/`](http://localhost:3000/) This environment now has all the diff --git a/examples/README.md b/examples/README.md index e9f7610d..082c121c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -4,14 +4,14 @@ This folder includes all the official tuono starters. To simply scaffold the base project run in your terminal: -```shell -$ tuono new [NAME] +```sh +tuono new [NAME] ``` You can install any example included in this folder by just using the `--template` flag: -```shell -$ tuono new [NAME] --template [TEMPLATE] +```sh +tuono new [NAME] --template [TEMPLATE] ``` `[TEMPLATE]` is the folder name. diff --git a/examples/tuono-app/README.md b/examples/tuono-app/README.md index 72b0fe6d..6cecfae3 100644 --- a/examples/tuono-app/README.md +++ b/examples/tuono-app/README.md @@ -2,8 +2,8 @@ This is the starter tuono project. To download it run in your terminal: -```shell -$ tuono new [NAME] +```sh +tuono new my-first-tuono-app ``` diff --git a/examples/tuono-tutorial/README.md b/examples/tuono-tutorial/README.md index 36d8c7e1..0e603a24 100644 --- a/examples/tuono-tutorial/README.md +++ b/examples/tuono-tutorial/README.md @@ -4,6 +4,6 @@ This project is the outcome of the [tuono tutorial](https://tuono.dev/documentat If you want to directly install it you can run: -```bash -$ tuono new my-project -t tuono-tutorial +```sh +tuono new -t tuono-tutorial ``` diff --git a/examples/with-mdx/README.md b/examples/with-mdx/README.md index 72b0fe6d..e70c2648 100644 --- a/examples/with-mdx/README.md +++ b/examples/with-mdx/README.md @@ -1,9 +1,7 @@ -# Tuono starter +# Tuono with MDX starter This is the starter tuono project. To download it run in your terminal: -```shell -$ tuono new [NAME] +```sh +tuono new tuono-with-mdx --template with-mdx ``` - - diff --git a/examples/with-tailwind/README.md b/examples/with-tailwind/README.md index 03b50ca9..c97108c0 100644 --- a/examples/with-tailwind/README.md +++ b/examples/with-tailwind/README.md @@ -2,8 +2,8 @@ This is the starter project for using Tuono and Tailwind CSS. To download it run in your terminal: -```shell -tuono new [NAME] --template with-tailwind +```sh +tuono new tuono-with-tailwind --template with-tailwind ``` To learn about how to set this up yourself, read our [Tailwind CSS documentation page](https://tuono.dev/documentation/styles/tailwind-css).