Skip to content

Commit f01892b

Browse files
committed
feat: add i18n support for documentation
1 parent 4e4ec79 commit f01892b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1894
-347
lines changed

.vitepress/config.mts

Lines changed: 0 additions & 67 deletions
This file was deleted.

.vitepress/config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from "vitepress";
2+
import { shared } from "./shared";
3+
import { en } from "./en";
4+
import { zh } from "./zh";
5+
6+
export default defineConfig({
7+
...shared,
8+
locales: {
9+
root: { label: "English", ...en },
10+
zh: { label: "简体中文", ...zh },
11+
},
12+
});

.vitepress/en.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { defineConfig } from "vitepress";
2+
3+
export const en = defineConfig({
4+
lang: "en-US",
5+
themeConfig: {
6+
nav: [
7+
{ text: "Home", link: "/" },
8+
{ text: "Guide", link: "/guide/" },
9+
{ text: "Group", link: "https://t.me/GUI_for_Cores" },
10+
{ text: "Channel", link: "https://t.me/GUI_for_Cores_Channel" },
11+
],
12+
13+
sidebar: {
14+
"/guide/": {
15+
base: "/guide/",
16+
items: [
17+
{
18+
text: "通用文档",
19+
items: [
20+
{ text: "User Manual", link: "index.md" },
21+
{ text: "Installation", link: "01-install" },
22+
{ text: "Uninstallation", link: "02-uninstall" },
23+
{ text: "Update", link: "09-update" },
24+
{ text: "How it works", link: "03-how-it-works" },
25+
{ text: "Plugins System", link: "04-plugins" },
26+
{ text: "Scheduled Task System", link: "05-tasks" },
27+
{ text: "Mixin & Script", link: "06-mixin-script" },
28+
{ text: "Tips", link: "08-skills" },
29+
],
30+
},
31+
{
32+
text: "GUI.for.Clash",
33+
base: "/guide/gfc/",
34+
items: [
35+
{ text: "简介", link: "index.md" },
36+
{ text: "A Guide for GUI.for.Clash", link: "how-to-use" },
37+
],
38+
},
39+
{
40+
text: "GUI.for.SingBox",
41+
base: "/guide/gfs/",
42+
items: [
43+
{ text: "简介", link: "index.md" },
44+
{ text: "A Guide for GUI.for.SingBox", link: "community" },
45+
],
46+
},
47+
{
48+
text: "社区教程",
49+
base: "/guide/community/",
50+
items: [
51+
{
52+
text: "Import Custom Proxies",
53+
link: "01-add-proxies-and-rulesets",
54+
},
55+
{
56+
text: "Run TUN mode in Gnome Desktop Environment Without Password",
57+
link: "02-run-tun-mode-without-password",
58+
},
59+
],
60+
},
61+
],
62+
},
63+
},
64+
65+
footer: {
66+
message: "",
67+
copyright: "Copyright © 2023-present GUI-for-Cores",
68+
},
69+
},
70+
});

.vitepress/shared.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineConfig } from "vitepress";
2+
3+
export const shared = defineConfig({
4+
title: "GUI.for.Cores",
5+
description: "GUI for Cores Docs",
6+
7+
rewrites: {
8+
"en/:rest*": ":rest*",
9+
},
10+
11+
lastUpdated: true,
12+
cleanUrls: true,
13+
metaChunk: true,
14+
15+
themeConfig: {
16+
socialLinks: [{ icon: "github", link: "https://github.com/GUI-for-Cores" }],
17+
},
18+
});

.vitepress/zh.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { defineConfig } from "vitepress";
2+
3+
export const zh = defineConfig({
4+
lang: "zh-Hans",
5+
themeConfig: {
6+
nav: [
7+
{ text: "主页", link: "/zh/" },
8+
{ text: "指南", link: "/zh/guide/" },
9+
{ text: "群组", link: "https://t.me/GUI_for_Cores" },
10+
{ text: "频道", link: "https://t.me/GUI_for_Cores_Channel" },
11+
],
12+
13+
sidebar: {
14+
"/zh/guide/": {
15+
base: "/zh/guide/",
16+
items: [
17+
{
18+
text: "通用文档",
19+
items: [
20+
{ text: "项目指南", link: "index.md" },
21+
{ text: "安装", link: "01-install" },
22+
{ text: "卸载", link: "02-uninstall" },
23+
{ text: "更新", link: "09-update" },
24+
{ text: "运行原理", link: "03-how-it-works" },
25+
{ text: "插件系统", link: "04-plugins" },
26+
{ text: "计划任务系统", link: "05-tasks" },
27+
{ text: "混入与脚本", link: "06-mixin-script" },
28+
{ text: "使用技巧", link: "08-skills" },
29+
],
30+
},
31+
{
32+
text: "GUI.for.Clash",
33+
base: "/zh/guide/gfc/",
34+
items: [
35+
{ text: "简介", link: "index.md" },
36+
{ text: "使用教程", link: "how-to-use" },
37+
],
38+
},
39+
{
40+
text: "GUI.for.SingBox",
41+
base: "/zh/guide/gfs/",
42+
items: [
43+
{ text: "简介", link: "index.md" },
44+
{ text: "社区版教程", link: "community" },
45+
],
46+
},
47+
{
48+
text: "社区教程",
49+
base: "/zh/guide/community/",
50+
items: [
51+
{
52+
text: "添加节点和规则集",
53+
link: "01-add-proxies-and-rulesets",
54+
},
55+
{
56+
text: "在 Gnome 桌面环境中免密码运行 TUN 模式",
57+
link: "02-run-tun-mode-without-password",
58+
},
59+
],
60+
},
61+
],
62+
},
63+
},
64+
65+
footer: {
66+
message: "",
67+
copyright: "版权所有 © 2023 至今 GUI-for-Cores",
68+
},
69+
},
70+
});

en/guide/01-install.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Installation
2+
3+
## 1. Download
4+
5+
> Latest GUI.for.Clash: [Download Link](https://github.com/GUI-for-Cores/GUI.for.Clash/releases/latest)
6+
7+
> Latest GUI.for.SingBox: [Download Link](https://github.com/GUI-for-Cores/GUI.for.SingBox/releases/latest)
8+
9+
We provide the following files for different OS and CPU architectures in the project's Github Releases page
10+
11+
- Windows-amd64
12+
- Windows-arm64
13+
- Windows-386
14+
- macOS-amd64
15+
- macOS-arm64
16+
- Ubuntu-amd64
17+
18+
Check the device's operating system and CPU architecture, download the corresponding file
19+
20+
## 2. Windows
21+
22+
Unzip the downloaded file, and move it to any folder of your choice;
23+
24+
Take GUI.for.Clash as an example: `D:\MyPrograms\GUI.for.Cores\GUI.for.Clash`;
25+
26+
The path of the exe file is: `D:\MyPrograms\GUI.for.Cores\GUI.for.Clash\GUI.for.Clash.exe`.
27+
28+
Notes:
29+
30+
- Avoid using `spaces` in the path
31+
- Avoid using `Chinese characters` in the path
32+
33+
34+
## 3. macOS
35+
36+
Double click the zip file, move the `unzipped` file to `Desktop`, follow these steps:
37+
38+
1. Double click the executable, The error message "**Cannot open... because the developer cannot be verified**", click Cancel button;
39+
40+
2. Go to System Settings - Privacy & Security - Security, "**Cannot be opened because the developer cannot be verified**", click "**Open Anyway**", enter the password to confirm.
41+
42+
Note:
43+
44+
- The unzipped executable must be `moved` at least once (as the example step above, it is moved from Downloads to Desktop), otherwise the executable will not have the `permission to write`
45+
46+
## 4. Linux
47+
48+
> Only tested on Ubuntu 22.04.4, if you are on other distributions, download the same file and try to run it.
49+
50+
Unzipped the file, move the executable to the directory of your choice, take GUI.for.Clash for example: `/opt/GUI.for.Clash`
51+
52+
Create the desktop shortcut manually: create a file named `GUI.for.Clash.desktop`, copy and paste the following content, move the file to `/usr/share/applications` directory
53+
54+
```
55+
[Desktop Entry]
56+
Version=1.0
57+
Name=GUI.for.Clash
58+
Comment=GUI.for.Clash
59+
Exec=/path/to/GUI.for.Clash/GUI.for.Clash
60+
Icon=/path/to/GUI.for.Clash/appicon.png
61+
Terminal=false
62+
Type=Application
63+
Categories=Application;GUI.for.Clash;
64+
StartupNotify=true
65+
66+
```
67+
68+
## 5. Directory Dissection
69+
70+
Using GUI.for.Clash as an example:
71+
72+
```
73+
GUI.for.Clash
74+
└─ data // Application resource directory
75+
| ├─ .cache // Cache folder, temporary files should be placed in this directory
76+
| ├─ mihomo // Core files directory
77+
| ├─ plugins // Plugin directory, only stores plugin source code, each plugin corresponds to a plugin-xxx.js file
78+
| ├─ rolling-release // Rolling release resource directory, stores compiled frontend files
79+
| ├─ rulesets // Ruleset directory, referenced by the core application
80+
| ├─ subscribes // Subscription directory, referenced by the core application
81+
| ├─ third // Third-party application directory, third-party applications downloaded by plugins should be placed and run in this directory
82+
| ├─ plugins.yaml // Plugin index file
83+
| ├─ profiles.yaml // Configuration index file
84+
| ├─ rulesets.yaml // Ruleset index file
85+
| ├─ scheduledtasks.yaml // Scheduled tasks index file
86+
| ├─ subscribes.yaml // Subscriptions index file
87+
| └─ user.yaml // Application configuration file: APP settings, plugin settings
88+
└─ GUI.for.Clash.exe // Main application
89+
```

en/guide/02-uninstall.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Uninstallation
2+
3+
## If the application has been run
4+
5+
1. Please run the application again and revert some changes
6+
7+
In the Settings page, turn off `Run As Admin` and `Startup on Boot`
8+
9+
Completely exit the application, including terminating the core process.
10+
11+
1. Delete the folder: `%APPDATA%\[BinaryName.exe]`
12+
13+
BinaryName is the application's name
14+
15+
1. Delete the `data` folder (you can keep it if you want)
16+
17+
The `data` folder is in the same directory as the application, it is created when the application starts and stores binaries, subscriptions, configurations, rulesets, plugins and scheduled tasks files
18+
19+
## If the application has not been run
20+
21+
You should give it a try

en/guide/03-how-it-works.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# How it works
2+
3+
Now let's understand how the application works by configuring and starting it normally
4+
5+
## 1. Getting Started
6+
7+
When running the application for the first time, there is a `Quick Start` button. Enter the subscription link, and after saving it, GUI performs the following actions:
8+
9+
1. Creates a config segment(profile) in profiles.yaml. This segment is the configuration for GUI, not for the cores
10+
11+
2. Creates a subscription data segment(subscription) in subscribes.yaml, including the subscription link, expiration date and traffic details
12+
13+
3. Fetches the subscription data, reads the proxies infomation from it, and saves them to `subscribes/ID_xxxxxx.yaml`. The files are named with random IDs
14+
15+
4. If the subscription data is successfully fetched, a successful initialization notification will be displayed, and the core will be ready to start. If the application fails to fetch the subscription data, the user must go to the `Subscriptions` page and manually update the corresponding subscription
16+
17+
## 2. Starting with a Profile
18+
19+
Choose a profile, click the `Click to Start` button, GUI will generate a `config.yaml` or `config.json` file based on the chosen profile and call the core application to run with it. If multiple profiles were created, right-click on one of them in the `profiles` page, in the `More` submenu, click `Start/Restart with This Profile`. The profiles at the top of the `Profiles` page will be displayed on the `Overview` page, with a maximum of `4` configurations shown
20+
21+
22+
## 3. Configuring as System Proxy
23+
24+
By default, GUI does not configure itself as system proxy automatically. When `System Proxy` button on the `Overview` page is clicked, GUI reads HTTP port and Mixed port from the configuration file and chooses one of them as the system proxy. The Mixed port always has higher priority than the HTTP port
25+
26+
## 4. TUN Mode
27+
28+
In TUN mode, GUI does not make any modifications to the operating system. Creating the virtual adapters and configuring the routes are done by the cores. TUN mode requires administrator privileges. Please turn on `Run as Admin` in the Settings page, exit the application, and re-open it. Please refrain from using the application's Restart button from any menu in this step.
29+
30+
Turning on TUN mode is a bit complicated on Linux and macOS, there is no simplified solution so far, so please run the commands manually:
31+
32+
On macOS:
33+
34+
```bash
35+
# Please replace ${KernelFilePath} with the actual path of the core file
36+
osascript -e 'do shell script "chown root:admin ${KernelFilePath}\nchmod +sx ${KernelFilePath}" with administrator privileges'
37+
```
38+
39+
On Linux:
40+
41+
```bash
42+
# Please replace ${KernelFilePath} with the actual path of the core file
43+
sudo setcap cap_net_bind_service,cap_net_admin,cap_dac_override=+ep ${KernelFilePath}
44+
```

0 commit comments

Comments
 (0)