📝 More authentic documentation

This commit is contained in:
Tw93
2025-08-26 15:08:01 +08:00
parent bf36cd4700
commit f084b2fb75
5 changed files with 144 additions and 38 deletions

64
bin/README.md vendored
View File

@@ -2,10 +2,30 @@
## Installation
Ensure that your Node.js version is 22.0 or higher (e.g., 22.11.0). _Note: Older versions ≥16.0.0 may also work._ Avoid using `sudo` for the installation. If you encounter permission issues with npm, refer to [How to fix npm throwing error without sudo](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo).
Ensure that your Node.js version is 22.0 or higher (e.g., 22.11.0). _Note: Older versions ≥18.0.0 may also work._
**Recommended (pnpm):**
```bash
npm install pake-cli -g
pnpm install -g pake-cli
```
**Alternative (npm):**
```bash
npm install -g pake-cli
```
**If you encounter permission issues:**
```bash
# Use npx to run without global installation
npx pake-cli [url] [options]
# Or fix npm permissions permanently
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
```
<details>
@@ -41,6 +61,19 @@ npm install pake-cli -g
</details>
## Quick Start
```bash
# Basic usage - just provide a URL
pake https://weekly.tw93.fun --name "Weekly"
# With custom icon and window size (macOS example)
pake https://weekly.tw93.fun --name "Weekly" --icon https://cdn.tw93.fun/pake/weekly.icns --width 1200 --height 800
# macOS immersive experience
pake https://weekly.tw93.fun --name "Weekly" --hide-title-bar
```
## CLI Usage
```bash
@@ -59,7 +92,18 @@ The URL is the link to the web page you want to package or the path to a local H
### [options]
Various options are available for customization. You can pass corresponding arguments during packaging to achieve the desired configuration.
Various options are available for customization. Here are the most commonly used ones:
| Option | Description | Example |
| ------------------ | ------------------------------ | ---------------------------------------------- |
| `--name` | Application name | `--name "Weekly"` |
| `--icon` | Application icon | `--icon https://cdn.tw93.fun/pake/weekly.icns` |
| `--width` | Window width (default: 1200px) | `--width 1400` |
| `--height` | Window height (default: 780px) | `--height 900` |
| `--hide-title-bar` | Immersive header (macOS only) | `--hide-title-bar` |
| `--debug` | Enable development tools | `--debug` |
For complete options, see detailed sections below.
#### [name]
@@ -80,7 +124,7 @@ Specify the application name. If not provided, you will be prompted to enter it.
#### [icon]
Specify the application icon. Supports both local and remote files. By default, it uses the Pake brand icon. For custom icons, visit [icon icons](https://icon-icons.com) or [macOSicons](https://macosicons.com/#/).
Specify the application icon. Supports both local and remote files. If not provided, Pake will intelligently fetch the website's icon. For custom icons, visit [icon-icons](https://icon-icons.com) or [macOSicons](https://macosicons.com/#/).
- For macOS, use `.icns` format.
- For Windows, use `.ico` format.
@@ -88,6 +132,10 @@ Specify the application icon. Supports both local and remote files. By default,
```shell
--icon <path>
# Examples:
--icon ./my-icon.png
--icon https://cdn.tw93.fun/pake/weekly.icns # Remote icon (.icns for macOS)
```
#### [height]
@@ -229,7 +277,7 @@ Customize the browser user agent. Default is empty.
#### [show-system-tray]
Display the system tray. Default is not to display. Use the following command to enable the system tray.
Display the application in system tray. Default is `false`.
```shell
--show-system-tray
@@ -245,7 +293,7 @@ Specify the system tray icon. This is only effective when the system tray is ena
#### [hide-on-close]
Hide the window instead of exiting when clicking the close button. Default is `true`. When enabled, the application will be minimized to the system tray (if available) or hidden when the close button is clicked, rather than actually closing the application.
Hide window instead of closing the application when clicking close button. Default is `true`.
```shell
--hide-on-close
@@ -328,13 +376,13 @@ Set proxy server for all network requests. Supports HTTP, HTTPS, and SOCKS5. Ava
#### [debug]
The packaged application has dev-tools for debugging, in addition to outputting more log messages for debugging.
Enable developer tools and detailed logging for debugging.
```shell
--debug
```
### Wait a moment
### Packaging Complete
After completing the above steps, your application should be successfully packaged. Please note that the packaging process may take some time depending on your system configuration and network conditions. Be patient, and once the packaging is complete, you can find the application installer in the specified directory.

65
bin/README_CN.md vendored
View File

@@ -2,10 +2,30 @@
## 安装
请确保您的 Node.js 版本为 22 或更高版本(例如 22.11.0。_注意较旧的版本 ≥16.0.0 也可能可以工作。_ 请避免使用 `sudo` 进行安装。如果 npm 报告权限问题,请参考 [如何在不使用 sudo 的情况下修复 npm 报错](https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo)。
请确保您的 Node.js 版本为 22 或更高版本(例如 22.11.0。_注意较旧的版本 ≥18.0.0 也可能可以工作。_
**推荐方式 (pnpm)**
```bash
npm install pake-cli -g
pnpm install -g pake-cli
```
**备选方式 (npm)**
```bash
npm install -g pake-cli
```
**如果遇到权限问题:**
```bash
# 使用 npx 运行,无需全局安装
npx pake-cli [url] [选项]
# 或者永久修复 npm 权限
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
```
<details>
@@ -41,6 +61,19 @@ npm install pake-cli -g
</details>
## 快速开始
```bash
# 基础用法 - 只需要提供URL
pake https://weekly.tw93.fun --name "Weekly"
# 自定义图标和窗口大小macOS示例
pake https://weekly.tw93.fun --name "Weekly" --icon https://cdn.tw93.fun/pake/weekly.icns --width 1200 --height 800
# macOS 沉浸式体验
pake https://weekly.tw93.fun --name "Weekly" --hide-title-bar
```
## 命令行使用
```bash
@@ -59,7 +92,18 @@ pake [url] [options]
### [options]
您可以通过传递以下选项来定制打包过程:
您可以通过传递以下选项来定制打包过程。以下是最常用的选项
| 选项 | 描述 | 示例 |
| ------------------ | ------------------------ | ---------------------------------------------- |
| `--name` | 应用程序名称 | `--name "Weekly"` |
| `--icon` | 应用程序图标 | `--icon https://cdn.tw93.fun/pake/weekly.icns` |
| `--width` | 窗口宽度默认1200px | `--width 1400` |
| `--height` | 窗口高度默认780px | `--height 900` |
| `--hide-title-bar` | 沉浸式标题栏仅macOS | `--hide-title-bar` |
| `--debug` | 启用开发者工具 | `--debug` |
完整选项请参见下面的详细说明:
#### [name]
@@ -80,8 +124,7 @@ pake [url] [options]
#### [icon]
指定应用程序的图标,支持本地或远程文件。默认使用 Pake 的内置图标。您可以访问 [icon-icons](https://icon-icons.com)
或 [macOSicons](https://macosicons.com/#/) 下载自定义图标。
指定应用程序的图标,支持本地或远程文件不传此参数时Pake 会智能获取网站图标。自定义图标可访问 [icon-icons](https://icon-icons.com) 或 [macOSicons](https://macosicons.com/#/) 下载。
- macOS 要求使用 `.icns` 格式。
- Windows 要求使用 `.ico` 格式。
@@ -89,6 +132,10 @@ pake [url] [options]
```shell
--icon <path>
# 示例:
--icon ./my-icon.png
--icon https://cdn.tw93.fun/pake/weekly.icns # 远程图标(.icns适用于macOS
```
#### [height]
@@ -229,7 +276,7 @@ pake [url] [options]
#### [show-system-tray]
设置是否显示通知栏托盘,默认不显示
设置应用程序显示在系统托盘,默认为 `false`
```shell
--show-system-tray
@@ -245,7 +292,7 @@ pake [url] [options]
#### [hide-on-close]
设置点击关闭按钮时隐藏窗口而不是退出应用。默认为 `true`。启用后,点击关闭按钮时应用会最小化到系统托盘(如果可用)或隐藏窗口,而不是直接关闭应用程序。
点击关闭按钮时隐藏窗口而不是退出应用程序。默认为 `true`。
```shell
--hide-on-close
@@ -328,13 +375,13 @@ pake https://flutter.dev --name FlutterApp --wasm
#### [debug]
打出来的包具备 dev-tools 的调试模式,此外还会输出更多的日志信息用于调试。
启用开发者工具和详细日志输出,用于调试。
```shell
--debug
```
### 稍等片刻
### 打包完成
完成上述步骤后,您的应用程序应该已经成功打包。请注意,根据您的系统配置和网络状况,打包过程可能需要一些时间。请耐心等待,一旦打包完成,您就可以在指定的目录中找到应用程序安装包。