我@嘉義
607 字
3 分鐘
Fuwari 語法總集
檔案結構
貼文 metadata
title: My First Blog Postpublished: 2023-09-09description: This is the first post of my new Astro blog.image: ./cover.jpg # Optionaltags: [Foo, Bar]category: Front-enddraft: false圖片
src/content/posts/├── post-1.md└── post-2/ ├── cover.png └── index.mdMarkdown Extended
GitHub Card
::github{repo="minstrike520/blog-fuwari"}Waiting for api.github.com...
GitHub-styled Callouts
NOTE
Highlights information that users should take into account, even when skimming.
TIPOptional information to help a user be more successful.
WARNING
Crucial information necessary for users to succeed.
WARNING
Critical content demanding immediate user attention due to potential risks.
Negative potential consequences of an action.
程式語法
隱藏字元
:spoiler[你知道的太多了]隱藏字元在此:「
跳脫字元
Standard ANSI colors:- Dimmed: Black Red Green Yellow Blue Magenta Cyan White - Foreground: Black Red Green Yellow Blue Magenta Cyan White - Background: Black Red Green Yellow Blue Magenta Cyan White - Reversed: Black Red Green Yellow Blue Magenta Cyan White
8-bit colors (showing colors 160-171 as an example):- Dimmed: 160 161 162 163 164 165 166 167 168 169 170 171 - Foreground: 160 161 162 163 164 165 166 167 168 169 170 171 - Background: 160 161 162 163 164 165 166 167 168 169 170 171 - Reversed: 160 161 162 163 164 165 166 167 168 169 170 171
24-bit colors (full RGB):- Dimmed: ForestGreen - RGB(34,139,34) RebeccaPurple - RGB(102,51,153) - Foreground: ForestGreen - RGB(34,139,34) RebeccaPurple - RGB(102,51,153) - Background: ForestGreen - RGB(34,139,34) RebeccaPurple - RGB(102,51,153) - Reversed: ForestGreen - RGB(34,139,34) RebeccaPurple - RGB(102,51,153)
Font styles:- Default- Bold- Dimmed- Italic- Underline- Reversed- Strikethrough如果直接複製命令行程式輸出,並不會複製到它附帶的 ANSI 資訊。我們可以利用許多程式支援的 --color=always 旗標加上 Bash 的重新導向語法(如 | nvim 或 > output.ansi)來獲得。
# === COLOR_PRINTCOLOR_PRINT_DBG=Truedef print_err(*args, **kwargs): print('\033[31m[Error] \033[0m', end=''); print(*args, **kwargs)def print_info(*args, **kwargs): print('\033[32m[Info] \033[0m', end=''); print(*args, **kwargs)def print_warn(*args, **kwargs): print('\033[33m[Warn] \033[0m', end=''); print(*args, **kwargs)def print_dbg(*args, **kwargs): if not COLOR_PRINT_DBG: return print('\033[34m[DEBUG] \033[0m', end=''); print(*args, **kwargs)# /=== COLOR_PRINT
print_dbg('test')標注
```js {1, 4, 7-8}// Line 1 - targeted by line number// Line 2// Line 3// Line 4 - targeted by line number// Line 5// Line 6// Line 7 - targeted by range "7-8"// Line 8 - targeted by range "7-8"```// Line 1 - targeted by line number// Line 2// Line 3// Line 4 - targeted by line number// Line 5// Line 6// Line 7 - targeted by range "7-8"// Line 8 - targeted by range "7-8"關閉行號
#include <stdio.h>
int main() { printf("this is awesome!"); return 0;}檔名
#include <test.h>
int impl_test() { return 0;} Fuwari 語法總集
https://blade520.com/posts/fuwari-syntax/