Skip to content

Commit f669e94

Browse files
committed
Add: extra ascii styles + config-free mode, Change: Readme changed with extra informations.
1 parent fe747d9 commit f669e94

6 files changed

Lines changed: 138 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,82 @@ At its core, it works simply and the codebase is easy to understand. 💡
7373
- `getLocale`
7474
Returns your system **locale** (e.g., `en_US`).
7575

76+
# F-Fetch Style ANSI Color Codes Reference
77+
78+
## 🎨 Foreground Colors (Text Colors)
79+
80+
| Placeholder | ANSI Code | Color | Description |
81+
|-------------|-----------|-------|-------------|
82+
| `fg.black` | `\x1b[30m` || Black text |
83+
| `fg.red` | `\x1b[31m` | 🔴 | Red text |
84+
| `fg.green` | `\x1b[32m` | 🟢 | Green text |
85+
| `fg.yellow` | `\x1b[33m` | 🟡 | Yellow text |
86+
| `fg.blue` | `\x1b[34m` | 🔵 | Blue text |
87+
| `fg.magenta` | `\x1b[35m` | 🟣 | Magenta text |
88+
| `fg.cyan` | `\x1b[36m` | 🔵 | Cyan text |
89+
| `fg.white` | `\x1b[37m` || White text |
90+
91+
## ✨ Bright Foreground Colors
92+
93+
| Placeholder | ANSI Code | Color | Description |
94+
|-------------|-----------|-------|-------------|
95+
| `fg.bright_black` | `\x1b[90m` || Bright black (gray) text |
96+
| `fg.bright_red` | `\x1b[91m` | 🔴 | Bright red text |
97+
| `fg.bright_green` | `\x1b[92m` | 🟢 | Bright green text |
98+
| `fg.bright_yellow` | `\x1b[93m` | 🟡 | Bright yellow text |
99+
| `fg.bright_blue` | `\x1b[94m` | 🔵 | Bright blue text |
100+
| `fg.bright_magenta` | `\x1b[95m` | 🟣 | Bright magenta text |
101+
| `fg.bright_cyan` | `\x1b[96m` | 🔵 | Bright cyan text |
102+
| `fg.bright_white` | `\x1b[97m` || Bright white text |
103+
104+
## 🎭 Background Colors
105+
106+
| Placeholder | ANSI Code | Color | Description |
107+
|-------------|-----------|-------|-------------|
108+
| `bg.black` | `\x1b[40m` || Black background |
109+
| `bg.red` | `\x1b[41m` | 🔴 | Red background |
110+
| `bg.green` | `\x1b[42m` | 🟢 | Green background |
111+
| `bg.yellow` | `\x1b[43m` | 🟡 | Yellow background |
112+
| `bg.blue` | `\x1b[44m` | 🔵 | Blue background |
113+
| `bg.magenta` | `\x1b[45m` | 🟣 | Magenta background |
114+
| `bg.cyan` | `\x1b[46m` | 🔵 | Cyan background |
115+
| `bg.white` | `\x1b[47m` || White background |
116+
117+
## 🌟 Bright Background Colors
118+
119+
| Placeholder | ANSI Code | Color | Description |
120+
|-------------|-----------|-------|-------------|
121+
| `bg.bright_black` | `\x1b[100m` || Bright black (gray) background |
122+
| `bg.bright_red` | `\x1b[101m` | 🔴 | Bright red background |
123+
| `bg.bright_green` | `\x1b[102m` | 🟢 | Bright green background |
124+
| `bg.bright_yellow` | `\x1b[103m` | 🟡 | Bright yellow background |
125+
| `bg.bright_blue` | `\x1b[104m` | 🔵 | Bright blue background |
126+
| `bg.bright_magenta` | `\x1b[105m` | 🟣 | Bright magenta background |
127+
| `bg.bright_cyan` | `\x1b[106m` | 🔵 | Bright cyan background |
128+
| `bg.bright_white` | `\x1b[107m` || Bright white background |
129+
130+
## 📝 Text Styles
131+
132+
| Placeholder | ANSI Code | Style | Description |
133+
|-------------|-----------|-------|-------------|
134+
| `t.bold` | `\x1b[1m` | **Bold** | Make text bold |
135+
| `t.dim` | `\x1b[2m` | Dim | Make text dimmed |
136+
| `t.italic` | `\x1b[3m` | *Italic* | Make text italic |
137+
| `t.underline` | `\x1b[4m` | <u>Underline</u> | Underline text |
138+
| `t.inverse` | `\x1b[7m` | Inverse | Swap foreground/background |
139+
| `t.hidden` | `\x1b[8m` | Hidden | Hide text |
140+
| `t.strike` | `\x1b[9m` | ~~Strike~~ | Strike through text |
141+
| `t.bold_off` | `\x1b[21m` | Normal | Turn off bold |
142+
| `t.underline_off` | `\x1b[24m` | Normal | Turn off underline |
143+
| `t.inverse_off` | `\x1b[27m` | Normal | Turn off inverse |
144+
145+
## 🔄 Reset
146+
147+
| Placeholder | ANSI Code | Function | Description |
148+
|-------------|-----------|----------|-------------|
149+
| `all.reset` | `\x1b[0m` | Reset | Reset all formatting |
150+
151+
---
76152

77153

78154
---

ascii/gentoo

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-/oyddmdhs+:.
2+
-odNMMMMMMMMNNmhy+-`
3+
-yNMMMMMMMMMMMNNNmmdhy+-
4+
`omMMMMMMMMMMMMNmdmmmmddhhy/`
5+
omMMMMMMMMMMMNhhyyyohmdddhhhdo`
6+
.ydMMMMMMMMMMdhs++so/smdddhhhhdm+`
7+
oyhdmNMMMMMMMNdyooydmddddhhhhyhNd.
8+
:oyhhdNNMMMMMMMNNNmmdddhhhhhyymMh
9+
.:+sydNMMMMMNNNmmmdddhhhhhhmMmy
10+
/mMMMMMMNNNmmmdddhhhhhmMNhs:
11+
`oNMMMMMMMNNNmmmddddhhdmMNhs+`
12+
`sNMMMMMMMMNNNmmmdddddmNMmhs/.
13+
/NMMMMMMMMNNNNmmmdddmNMNdso:`
14+
+MMMMMMMNNNNNmmmmdmNMNdso/-
15+
yMMNNNNNNNmmmmmNNMmhs+/-
16+
/hMMNNNNNNNNMNdhs++/-
17+
`/ohdmmddhys+++/:.`
18+
`-//////:--.

ascii/gentoo_small

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
_-----_
2+
( \
3+
\ 0 \
4+
\ )
5+
/ _/
6+
( _-
7+
\____-

ascii/ubuntu

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
....
2+
.',:clooo: .:looooo:.
3+
.;looooooooc .oooooooooo'
4+
.;looooool:,''. :ooooooooooc
5+
;looool;. 'oooooooooo,
6+
;clool' .cooooooc. ,,
7+
... ...... .:oo,
8+
.;clol:,. .loooo'
9+
:ooooooooo, 'ooool
10+
'ooooooooooo. loooo.
11+
'ooooooooool coooo.
12+
,loooooooc. .loooo.
13+
.,;;;'. ;ooooc
14+
... ,ooool.
15+
.cooooc. ..',,'. .cooo.
16+
;ooooo:. ;oooooooc. :l.
17+
.coooooc,.. coooooooooo.
18+
.:ooooooolc:. .ooooooooooo'
19+
.':loooooo; ,oooooooooc
20+
..';::c' .;loooo:'

src/main.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ use once_cell::sync::Lazy;
66
use regex::Regex;
77

88
fn read_lines(filename: &str) -> Vec<String> {
9-
if !Path::new(filename).exists() {
9+
let conf_path = Path::new(filename);
10+
if !conf_path.exists() {
11+
if let Some(parent) = conf_path.parent() {
12+
if !parent.exists() {
13+
fs::create_dir_all(parent).expect("Parent directory create error.");
14+
}
15+
}
16+
1017
let mut file = fs::File::create(filename).expect("file create error.");
1118
let content = r#"
1219
#####
@@ -62,7 +69,14 @@ lazy_static! {
6269
}
6370

6471
static CONTENTS: Lazy<Vec<String>> = Lazy::new(|| {
65-
if !Path::new(&*PATH).exists() {
72+
let conf_path = Path::new(&*PATH);
73+
if !conf_path.exists() {
74+
if let Some(parent) = conf_path.parent() {
75+
if !parent.exists() {
76+
println!("{:?}", parent);
77+
fs::create_dir_all(parent).expect("Parent directory create error.");
78+
}
79+
}
6680
let mut file = fs::File::create(&*PATH).expect("file create error.");
6781
let content = r#"
6882
# middle config

0 commit comments

Comments
 (0)