docs: use consistent snippet style across the codebase (#451)

Co-authored-by: wd <52734504+wdcodecn@users.noreply.github.com>
This commit is contained in:
Marco Pasqualetti
2025-01-29 08:33:55 +01:00
committed by GitHub
parent a4e207688a
commit ff7433f434
16 changed files with 37 additions and 46 deletions
-7
View File
@@ -1,7 +0,0 @@
# Tuono starter
This is the starter tuono project. To download it run in your terminal:
```shell
$ tuono new [NAME]
```
@@ -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 ? (
<IconCheck style={{ width: rem(20) }} />
@@ -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 <COMMAND>
@@ -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() {
@@ -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 <COMMAND>
@@ -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 <div>About</div>
}
@@ -25,7 +25,7 @@ To start, lets 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.
@@ -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 Rusts dependencies. All the other execution will be pretty quick!
@@ -29,7 +29,7 @@ These two will handle every request that points to `http://localhost:3000/pokemo
Lets 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;
@@ -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)
@@ -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
+4 -4
View File
@@ -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.
+2 -2
View File
@@ -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
```
+2 -2
View File
@@ -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
```
+3 -5
View File
@@ -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
```
+2 -2
View File
@@ -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).