Skip to content

Commit c48eb3b

Browse files
committed
Add diagrams and sponsor badge to documentation
Replaced text-based diagrams in lifetimes and modules chapters with image diagrams for improved clarity. Added a message passing channels diagram to the concurrency chapter. Introduced a sponsor badge in the README and created a FUNDING.yml file to support project sponsorship.
1 parent 7fd9f7f commit c48eb3b

8 files changed

Lines changed: 19 additions & 29 deletions

File tree

.github/FUNDING.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: # [string] Replace with up to 4 GitHub Sponsors-supported usernames e.g., [user1, user2]
4+
patreon: # [string] Replace with a single Patreon username
5+
open_collective: # [string] Replace with a single Open Collective username
6+
ko_fi: # [string] Replace with a single Ko-fi username
7+
tidelift: # [string] Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # [string] Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # [string] Replace with a single Liberapay username
10+
issuehunt: # [string] Replace with a single IssueHunt username
11+
otechie: # [string] Replace with a single Otechie username
12+
lfx_crowdfunding: # [string] Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: ['buymeacoffee.com/arrkpong'] # [list] Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Language: Thai](https://img.shields.io/badge/Language-Thai%20🇹🇭-blue.svg)](https://premix-kernel.github.io/rust-tutorial)
66
[![Rust](https://img.shields.io/badge/Rust-1.83+-orange.svg)](https://www.rust-lang.org/)
77
[![mdBook](https://img.shields.io/badge/Made%20with-mdBook-blue.svg)](https://rust-lang.github.io/mdBook/)
8+
[![Sponsor](https://img.shields.io/badge/Sponsor-%E2%9D%A4-pink)](https://github.com/sponsors/premix-kernel)
89

910
> 🦀 เอกสารสอนภาษา Rust สำหรับผู้เริ่มต้น | คำอธิบายภาษาไทย | โค้ดภาษาอังกฤษ
1011

docs/src/ch10-generics-traits/04-lifetimes.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,7 @@
2121

2222
### 🧠 Mental Model
2323

24-
```text
25-
+---------------------------------------------------------------+
26-
| Lifetime = Time Period |
27-
+---------------------------------------------------------------+
28-
| |
29-
| fn longest<'a>(x: &'a str, y: &'a str) -> &'a str |
30-
| ^ ^ ^ |
31-
| | | | |
32-
| +----------+--------------+ |
33-
| | |
34-
| "All share the same lifetime" |
35-
| |
36-
| Rule: Return value lives as long as the |
37-
| shortest-lived input between x and y |
38-
| |
39-
+---------------------------------------------------------------+
40-
```
24+
![Lifetime Scopes Diagram](../images/lifetime_scopes.png)
4125

4226
### 🔧 Common Patterns
4327

docs/src/ch11-modules/02-modules.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,7 @@
66

77
โปรเจกต์ Rust มีโครงสร้างเป็น tree:
88

9-
```text
10-
crate (root)
11-
├── front_of_house
12-
│ ├── hosting
13-
│ │ ├── add_to_waitlist
14-
│ │ └── seat_at_table
15-
│ └── serving
16-
│ ├── take_order
17-
│ └── serve_order
18-
└── back_of_house
19-
└── cook_order
20-
```
9+
![Module Tree Diagram](../images/module_tree.png)
2110

2211
---
2312

docs/src/ch15-concurrency/02-message-passing.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## Basic Channel
66

7+
![Message Passing Channels Diagram](../images/channels.png)
8+
9+
710
```rust,ignore
811
use std::sync::mpsc;
912
use std::thread;

docs/src/images/channels.png

462 KB
Loading
426 KB
Loading

docs/src/images/module_tree.png

518 KB
Loading

0 commit comments

Comments
 (0)