Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6185caa48 | ||
|
|
8efbddd44f | ||
|
|
1c3bc5681c | ||
|
|
40f748b5c5 | ||
|
|
08f42cf1ce | ||
|
|
580e875be5 | ||
|
|
b0c3ae4209 | ||
|
|
8513120d6e | ||
|
|
1fe5b8d0b5 | ||
|
|
9222e79760 | ||
|
|
b0e2d91376 | ||
|
|
c1c86bfa4b | ||
|
|
9a788dadfb | ||
|
|
0e09d307e3 | ||
|
|
b2d59873bb | ||
|
|
81c90ed060 | ||
|
|
bb794b7d81 | ||
|
|
3604cff181 |
No files matched your search
@@ -0,0 +1,95 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
# 三端出包:
|
||||||
|
# Windows → .exe(NSIS 安装包)
|
||||||
|
# macOS → .dmg(Intel + Apple Silicon 各一份)
|
||||||
|
# Linux → .deb / .AppImage
|
||||||
|
#
|
||||||
|
# Linux 版和 Windows 版本机就能交叉/原生编译,macOS 必须有苹果的编译链,
|
||||||
|
# 所以这里统一交给 GitHub Actions(macos-latest 就是真机 macOS)。
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- platform: macos-latest
|
||||||
|
target: aarch64-apple-darwin
|
||||||
|
label: macOS (Apple Silicon)
|
||||||
|
- platform: macos-latest
|
||||||
|
target: x86_64-apple-darwin
|
||||||
|
label: macOS (Intel)
|
||||||
|
- platform: ubuntu-22.04
|
||||||
|
target: ''
|
||||||
|
label: Linux
|
||||||
|
- platform: windows-latest
|
||||||
|
target: ''
|
||||||
|
label: Windows
|
||||||
|
|
||||||
|
name: ${{ matrix.label }}
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: 安装 Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
||||||
|
|
||||||
|
- name: 缓存 cargo
|
||||||
|
uses: swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: src-tauri
|
||||||
|
|
||||||
|
- name: 安装 Linux 系统依赖
|
||||||
|
if: matrix.platform == 'ubuntu-22.04'
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends \
|
||||||
|
libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \
|
||||||
|
librsvg2-dev libxdo-dev patchelf
|
||||||
|
|
||||||
|
- name: 安装前端依赖
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: 构建并上传产物
|
||||||
|
uses: tauri-apps/tauri-action@v0
|
||||||
|
env:
|
||||||
|
# 升级签名:把私钥内容存到仓库 Secret(TAURI_SIGNING_PRIVATE_KEY)
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||||
|
# macOS 代码签名(没有苹果开发者证书时留空,产物未签名,用户需右键「打开」)
|
||||||
|
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||||
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||||
|
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
|
with:
|
||||||
|
args: ${{ matrix.target != '' && format('--target {0}', matrix.target) || '' }}
|
||||||
|
|
||||||
|
- name: 上传构建产物
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: xiaoyin-markdown-${{ matrix.platform }}${{ matrix.target != '' && format('-{0}', matrix.target) || '' }}
|
||||||
|
path: |
|
||||||
|
src-tauri/target/**/release/bundle/**/*.exe
|
||||||
|
src-tauri/target/**/release/bundle/**/*.msi
|
||||||
|
src-tauri/target/**/release/bundle/**/*.dmg
|
||||||
|
src-tauri/target/**/release/bundle/**/*.deb
|
||||||
|
src-tauri/target/**/release/bundle/**/*.AppImage
|
||||||
|
src-tauri/target/**/release/bundle/**/*.tar.gz
|
||||||
|
src-tauri/target/**/release/bundle/**/*.sig
|
||||||
|
if-no-files-found: warn
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
一个纯本地的 Windows Markdown 编辑器。左边写、右边看,不联外网、不登录、不收集任何东西。
|
一个纯本地的 Windows Markdown 编辑器。左边写、右边看,不联外网、不登录、不收集任何东西。
|
||||||
|
|
||||||
> 官网 / 下载:<https://md.wangjinding.com>
|
> 官网 / 下载:<https://xymd.wangjinding.com>
|
||||||
|
|
||||||
## 装在哪(示例)
|
## 装在哪(示例)
|
||||||
|
|
||||||
@@ -147,6 +147,97 @@ npx electron-packager . XiaoyinMarkdown --platform=win32 --arch=x64 --out=dist ^
|
|||||||
|
|
||||||
打包完成后把 `dist\XiaoyinMarkdown-win32-x64` 整个目录拷到 `%USERPROFILE%\Apps\XiaoyinMarkdown` 覆盖即可(exe 依赖同目录的 dll,不能只拷 exe)。
|
打包完成后把 `dist\XiaoyinMarkdown-win32-x64` 整个目录拷到 `%USERPROFILE%\Apps\XiaoyinMarkdown` 覆盖即可(exe 依赖同目录的 dll,不能只拷 exe)。
|
||||||
|
|
||||||
|
## 三端支持(Windows / macOS / Linux)
|
||||||
|
|
||||||
|
| 平台 | 产物 | 状态 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Windows 10/11 x64 | `xymd_<版本>.exe`(NSIS 安装包)| ✅ 已发布 |
|
||||||
|
| Linux x86_64 | `xymd_<版本>_amd64.AppImage` / `.deb` | ✅ 已发布 |
|
||||||
|
| macOS 11+ | `xymd_<版本>_aarch64.dmg` / `_x64.dmg` | ⏳ 需在 macOS 上构建(见下)|
|
||||||
|
|
||||||
|
### 平台差异
|
||||||
|
|
||||||
|
| 能力 | Windows | macOS | Linux |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| 「复制文件本身」到剪贴板 | ✅ Win32 CF_HDROP | ⚠️ 退化为复制路径文本 | ⚠️ 退化为复制路径文本 |
|
||||||
|
| 在文件管理器中显示 | 资源管理器并选中 | `open -R` | `xdg-open` 打开所在目录 |
|
||||||
|
| 打开外部链接 | `explorer` | `open` | `xdg-open` |
|
||||||
|
| 文本剪贴板 | `clipboard-win` | `arboard` | `arboard` |
|
||||||
|
| 在线升级 | ✅ | ✅(需签名)| ✅(仅 AppImage 形态)|
|
||||||
|
|
||||||
|
macOS / Linux 的剪贴板没有跨平台的「文件」格式(要写 NSPasteboard / GTK 私有 target),
|
||||||
|
所以这两个平台上「复制文件」会退化成把**路径文本**放进剪贴板。
|
||||||
|
|
||||||
|
### 本机构建(Linux / Windows 交叉)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Linux 原生(需要 webkit2gtk-4.1 等系统库)
|
||||||
|
sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev
|
||||||
|
npx tauri build --bundles deb,appimage
|
||||||
|
|
||||||
|
# Windows(在 Linux 上交叉编译)
|
||||||
|
npx tauri build --target x86_64-pc-windows-gnu --bundles nsis
|
||||||
|
```
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
macOS 的包**必须**在 macOS 上构建(需要 Xcode 的命令行工具链,Linux 无法交叉编译):
|
||||||
|
仓库里的 `.github/workflows/build.yml` 会同时在 `macos-latest`(Apple Silicon + Intel)、
|
||||||
|
`ubuntu-22.04`、`windows-latest` 三个 runner 上出包,产物在 Actions 的 Artifacts 里。
|
||||||
|
|
||||||
|
需要在仓库 Secrets 里配:
|
||||||
|
- `TAURI_SIGNING_PRIVATE_KEY` / `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` —— 升级签名私钥
|
||||||
|
- `APPLE_CERTIFICATE` / `APPLE_CERTIFICATE_PASSWORD` / `APPLE_SIGNING_IDENTITY` —— 苹果开发者证书(可选)
|
||||||
|
- `APPLE_ID` / `APPLE_PASSWORD` / `APPLE_TEAM_ID` —— 公证用(可选)
|
||||||
|
|
||||||
|
没有苹果开发者证书时产物是**未签名**的,用户首次打开需要「右键 → 打开」,
|
||||||
|
或在终端执行 `xattr -dr com.apple.quarantine /Applications/XiaoyinMarkdown.app`。
|
||||||
|
|
||||||
|
### 发布
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/release/publish.py --notes-file notes.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
会自动扫描 `src-tauri/target` 下**存在的**产物(Windows / Linux / macOS 各归各位),
|
||||||
|
拷到官网 `download/`,并把对应平台写进 `update/latest.json`(**合并**语义:
|
||||||
|
在 Windows 上发版不会把 macOS 那条冲掉)。
|
||||||
|
|
||||||
|
## 用 Tauri 打包(推荐的安装包)
|
||||||
|
|
||||||
|
Tauri 版走系统 WebView2,**不用捆绑运行时**,安装包比 Electron 版小一个数量级。
|
||||||
|
在 Linux 上也能交叉编译出 Windows 安装包:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 一次性准备
|
||||||
|
apt-get install -y mingw-w64 nsis
|
||||||
|
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal # 国内可设 RUSTUP_DIST_SERVER 用清华镜像
|
||||||
|
rustup target add x86_64-pc-windows-gnu
|
||||||
|
mkdir -p ~/.cargo && cat >> ~/.cargo/config.toml <<'EOF'
|
||||||
|
[target.x86_64-pc-windows-gnu]
|
||||||
|
linker = "x86_64-w64-mingw32-gcc"
|
||||||
|
ar = "x86_64-w64-mingw32-ar"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# 打包
|
||||||
|
npm install
|
||||||
|
npx tauri build --target x86_64-pc-windows-gnu --bundles nsis
|
||||||
|
# → src-tauri/target/x86_64-pc-windows-gnu/release/bundle/nsis/XiaoyinMarkdown_<版本>_x64-setup.exe
|
||||||
|
```
|
||||||
|
|
||||||
|
### 装完 .md 默认用小银 Markdown 打开
|
||||||
|
|
||||||
|
两步配合,缺一不可:
|
||||||
|
|
||||||
|
1. `tauri.conf.json` 的 `bundle.fileAssociations` → 写 `HKCU\Software\Classes\.md` = `XiaoyinMarkdown.Document`
|
||||||
|
(含 markdown / mdown / mkd / mdwn / txt)
|
||||||
|
2. `src-tauri/installer-hooks.nsh`(NSIS `NSIS_HOOK_POSTINSTALL`)→ 删掉
|
||||||
|
`HKCU\...\Explorer\FileExts\.md\UserChoice`。这个键带哈希保护、**只能删不能写**,
|
||||||
|
删掉后系统才回落到第 1 步写的关联,否则用户原来的默认程序会一直赢。
|
||||||
|
|
||||||
|
首次双击 .md 时是冷启动,文件路径由 Rust 的 `on_page_load` 读 `argv` 发给前端
|
||||||
|
(`main.rs` 里的 `STARTUP_FILE_SENT`);程序已在运行时再双击,走 single-instance 回调。
|
||||||
|
|
||||||
## 说明
|
## 说明
|
||||||
|
|
||||||
- 未做代码签名,首次运行 Windows SmartScreen 可能提示"未知发布者",选"仍要运行"即可。
|
- 未做代码签名,首次运行 Windows SmartScreen 可能提示"未知发布者",选"仍要运行"即可。
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaoyin-markdown-editor",
|
"name": "xiaoyin-markdown-editor",
|
||||||
"productName": "XiaoyinMarkdown",
|
"productName": "XiaoyinMarkdown",
|
||||||
"version": "2.6.1",
|
"version": "2.6.7",
|
||||||
"description": "轻量本地 Markdown 编辑器:实时预览、多标签/多窗口、查找高亮、右键复制全文/打开目录、常用快捷键",
|
"description": "轻量本地 Markdown 编辑器:实时预览、多标签/多窗口、查找高亮、右键复制全文/打开目录、常用快捷键",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"author": "小银",
|
"author": "小银",
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
# 官网部署说明(xymd.wangjinding.com)
|
||||||
|
|
||||||
|
> **2026-11-20 域名迁移完成**:官网从 `md.wangjinding.com` 迁到 `xymd.wangjinding.com`。
|
||||||
|
> 旧域名已**彻底下线** —— EdgeOne 加速域名、1Panel 站点、WAF 条目、DNS 记录、acme 证书全部删除。
|
||||||
|
> 站点根目录现在是真的独立目录(`/opt/1panel/www/sites/<域名>/index`),
|
||||||
|
> 不再是软链,删旧站不会影响新站。
|
||||||
|
|
||||||
|
|
||||||
|
## 链路
|
||||||
|
|
||||||
|
```
|
||||||
|
访客 ──https://xymd.wangjinding.com:443──► EdgeOne 边缘(免费 TrustAsia 证书)
|
||||||
|
│ 回源 HTTPS 8443,Host=加速域名
|
||||||
|
▼
|
||||||
|
<回源域名>:8443 ──(光猫映射)──► .8 的 OpenResty
|
||||||
|
│ server_name 分流
|
||||||
|
▼
|
||||||
|
/opt/1panel/www/sites/<域名>/index
|
||||||
|
```
|
||||||
|
|
||||||
|
## 各部分落在哪
|
||||||
|
|
||||||
|
| 环节 | 位置 / 参数 |
|
||||||
|
| --- | --- |
|
||||||
|
| 站点根目录 | `/opt/1panel/www/sites/<域名>/index` |
|
||||||
|
| nginx 配置 | `/opt/1panel/www/conf.d/<域名>.conf`(8082 + 8443 ssl)|
|
||||||
|
| 源站证书 | `/opt/1panel/www/sites/<域名>/ssl/`(acme.sh + 阿里云 DNS-01,自动续期)|
|
||||||
|
| 安装包 | `index/download/XiaoyinMarkdown-win32-x64.zip` |
|
||||||
|
| EdgeOne | zone `zone-xxxxxxxx`,加速域名 `xymd.wangjinding.com`,回源 HTTPS/8443 |
|
||||||
|
| WAF 白名单 | `1pwaf/data/conf/sites.json` + `1pwaf/data/sites/xymd.wangjinding.com/config.json` |
|
||||||
|
| DNS | 阿里云 `xymd` CNAME → `xymd.wangjinding.com.eo.dnse2.com`(TTL 600)|
|
||||||
|
|
||||||
|
|
||||||
|
## 在 1Panel 面板里可见(重要)
|
||||||
|
|
||||||
|
只建 `conf.d/*.conf` + 站点目录,**面板列表里是看不到的** —— 面板的「网站」页读的是
|
||||||
|
`/opt/1panel/db/agent.db` 的 `websites` 表。要让站点出现在面板里、能用面板的「配置」页管理,
|
||||||
|
必须往库里登记(本次已登记:`websites.id=11`、`website_domains`、`website_ssls.id=15`):
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- websites:type='static',proxy 留空,site_dir='/'
|
||||||
|
insert into websites (..., protocol, primary_domain, type, alias, status, http_config, proxy, site_dir, ...)
|
||||||
|
values (..., 'HTTPS', 'xymd.wangjinding.com', 'static', 'xymd.wangjinding.com', 'Running',
|
||||||
|
'HTTPToHTTPS', '', '/', ...);
|
||||||
|
-- website_domains:(website_id, domain, ssl=0, port=8082)
|
||||||
|
-- website_ssls:(primary_domain, private_key, pem, key_type='EC256', type='YE2',
|
||||||
|
-- expire_date, start_date, status='ready', auto_renew=1)
|
||||||
|
-- 再把 websites.website_ssl_id 指过去
|
||||||
|
```
|
||||||
|
|
||||||
|
注意:
|
||||||
|
- `website_ssls` 的布尔列必须是 0/1(写 `''` 会让面板整页 `sql: Scan error`)。
|
||||||
|
- 证书内容直接从 `sites/<域名>/ssl/{fullchain,privkey}.pem` 读进去,面板的「证书」页才显示得出来。
|
||||||
|
- 面板刷新后即可见(Ctrl+F5);若没出现,`systemctl restart 1panel-agent` 一次。
|
||||||
|
- ⚠️ **在面板里改这个站点的配置时,nginx conf 会被面板模板重写** ——
|
||||||
|
我加的 `Strict-Transport-Security` 头、`/download/` 的 `Content-Disposition: attachment`
|
||||||
|
可能会丢,改完记得复查 `conf.d/xymd.wangjinding.com.conf`。
|
||||||
|
|
||||||
|
## 更新页面
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp site/index.html /opt/1panel/www/sites/<域名>/index/
|
||||||
|
docker exec 1Panel-openresty-npAh nginx -s reload # 一般不需要,静态文件直接生效
|
||||||
|
```
|
||||||
|
|
||||||
|
## 更新安装包
|
||||||
|
|
||||||
|
官网主下载项是 **Tauri 安装包**(装完 .md 默认用它打开):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1) 交叉编译 Windows 安装包(详见仓库 README「用 Tauri 打包」)
|
||||||
|
npx tauri build --target x86_64-pc-windows-gnu --bundles nsis
|
||||||
|
|
||||||
|
# 2) 发布
|
||||||
|
R=src-tauri/target/x86_64-pc-windows-gnu/release
|
||||||
|
cp $R/bundle/nsis/XiaoyinMarkdown_2.6.1_x64-setup.exe \
|
||||||
|
/opt/1panel/www/sites/<域名>/index/download/
|
||||||
|
cp $R/xiaoyin-markdown.exe \
|
||||||
|
/opt/1panel/www/sites/<域名>/index/download/XiaoyinMarkdown-portable.exe
|
||||||
|
```
|
||||||
|
|
||||||
|
旧版 Electron 构建(`XiaoyinMarkdown-win32-x64.zip`)仍保留在 `download/` 里。
|
||||||
|
|
||||||
|
## 坑
|
||||||
|
|
||||||
|
- **WAF 白名单**:不往 `sites.json` 加 `{"key": "<域名>", "host": ["<域名>:8082"]}`,
|
||||||
|
就会**本机 200、公网 403「网站不存在」**(本次踩过)。
|
||||||
|
- **EdgeOne 过渡期**:新加速域名 `process` 状态下访问会被边缘直接 Reset(curl 显示 000),
|
||||||
|
证书 `applying → processing → deployed`,全程约 10–15 分钟,别当成配错了。
|
||||||
|
- **缓存**:站点级策略是 NoCache,主安装包(Tauri 版,2 MB 左右)每次回源压力不大;
|
||||||
|
但旧的 Electron 包有 152MB,有人下就整包走家宽上行。
|
||||||
|
要提速得在 EdgeOne 给 `/download/*` 单独加缓存规则。
|
||||||
|
- **带宽账**:EO 免费额度 50GB/月。按 2 MB 的 Tauri 包算够下两万多次;
|
||||||
|
按 152MB 的 Electron 包算只有 330 次左右 —— 所以主下载项别指回 Electron 包。
|
||||||
|
After Width: | Height: | Size: 147 KiB |
|
After Width: | Height: | Size: 153 KiB |
|
After Width: | Height: | Size: 149 KiB |
|
After Width: | Height: | Size: 102 KiB |
@@ -3,352 +3,628 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>小银 Markdown — 纯本地 Windows Markdown 编辑器</title>
|
<title>小银 Markdown — 纯本地 Markdown 编辑器 · Windows / macOS / Linux</title>
|
||||||
<meta name="description" content="小银 Markdown:纯本地的 Windows Markdown 编辑器。左边写、右边看,实时预览、多标签/多窗口、章节大纲、查找高亮。不联网、不登录、不收集任何数据。">
|
<meta name="description" content="小银 Markdown:纯本地的 Markdown 编辑器,Windows / macOS / Linux 三端同源。实时预览、多标签/多窗口、章节大纲、查找高亮,支持在线升级。不联网、不登录、不收集任何数据。">
|
||||||
<meta name="theme-color" content="#0d1117">
|
<meta name="theme-color" content="#ffffff">
|
||||||
<link rel="icon" href="/favicon.png">
|
<link rel="icon" href="/favicon.png">
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root{
|
||||||
--bg: #0b0e14;
|
--blue:#3a7bfc; --blue-d:#0b66dd; --blue-l:#7ba7ff; --blue-bg:#eef4ff;
|
||||||
--bg-2: #101521;
|
--ink:#2f2f30; --ink-2:#4c4c4c; --ink-3:#8a8a8f;
|
||||||
--card: rgba(255,255,255,.04);
|
--gray:#f8f8f8; --gray-2:#f2f2f7; --line:#e8e8ee;
|
||||||
--card-b: rgba(255,255,255,.08);
|
--dark:#242424; --yellow:#ffb200;
|
||||||
--fg: #e6edf3;
|
--max:1180px; --r:16px;
|
||||||
--fg-2: #9aa7b8;
|
--shadow:0 10px 40px -12px rgba(20,30,60,.18);
|
||||||
--fg-3: #6b7787;
|
--shadow-lg:0 24px 70px -25px rgba(20,30,60,.35);
|
||||||
--accent: #5b8cff;
|
|
||||||
--accent-2: #8b5cf6;
|
|
||||||
--ok: #34d399;
|
|
||||||
--radius: 16px;
|
|
||||||
--max: 1080px;
|
|
||||||
}
|
}
|
||||||
@media (prefers-color-scheme: light) {
|
*{box-sizing:border-box;margin:0;padding:0}
|
||||||
:root {
|
html{scroll-behavior:smooth}
|
||||||
--bg: #f7f9fc; --bg-2: #eef3fb;
|
body{
|
||||||
--card: #ffffff; --card-b: #e3ebf6;
|
font:16px/1.7 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
|
||||||
--fg: #101828; --fg-2: #5a6b82; --fg-3: #8a97a8;
|
color:var(--ink);background:#fff;-webkit-font-smoothing:antialiased;overflow-x:hidden;
|
||||||
--accent: #2563eb; --accent-2: #7c3aed;
|
|
||||||
}
|
}
|
||||||
}
|
a{color:inherit;text-decoration:none}
|
||||||
* { box-sizing: border-box; }
|
.wrap{max-width:var(--max);margin:0 auto;padding:0 24px}
|
||||||
html { scroll-behavior: smooth; }
|
|
||||||
body {
|
|
||||||
margin: 0; background: var(--bg); color: var(--fg);
|
|
||||||
font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
|
|
||||||
"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
}
|
|
||||||
a { color: var(--accent); text-decoration: none; }
|
|
||||||
a:hover { text-decoration: underline; }
|
|
||||||
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }
|
|
||||||
|
|
||||||
/* ── 顶部 ── */
|
/* ───────── 顶部导航 ───────── */
|
||||||
header {
|
header{
|
||||||
position: sticky; top: 0; z-index: 20;
|
position:sticky;top:0;z-index:50;background:rgba(255,255,255,.86);
|
||||||
backdrop-filter: blur(12px);
|
backdrop-filter:blur(14px);border-bottom:1px solid transparent;transition:.25s;
|
||||||
background: color-mix(in srgb, var(--bg) 82%, transparent);
|
|
||||||
border-bottom: 1px solid var(--card-b);
|
|
||||||
}
|
}
|
||||||
header .wrap { display: flex; align-items: center; gap: 14px; height: 62px; }
|
header.on{border-bottom-color:var(--line);box-shadow:0 2px 20px -12px rgba(0,0,0,.25)}
|
||||||
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
|
.nav{display:flex;align-items:center;gap:34px;height:66px}
|
||||||
.logo img { width: 26px; height: 26px; border-radius: 7px; }
|
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:17px;letter-spacing:.2px}
|
||||||
header nav { margin-left: auto; display: flex; gap: 20px; font-size: 14.5px; }
|
.brand img{width:30px;height:30px;border-radius:8px}
|
||||||
header nav a { color: var(--fg-2); }
|
.nav-links{display:flex;gap:30px;margin-left:14px;font-size:15px;color:var(--ink-2)}
|
||||||
header nav a:hover { color: var(--fg); text-decoration: none; }
|
.nav-links a{position:relative;padding:4px 0}
|
||||||
@media (max-width: 640px) { header nav { display: none; } }
|
.nav-links a:hover{color:var(--blue)}
|
||||||
|
.nav-cta{margin-left:auto;display:flex;align-items:center;gap:14px}
|
||||||
|
.nav-cta .ghost{font-size:15px;color:var(--ink-2)}
|
||||||
|
.nav-cta .ghost:hover{color:var(--blue)}
|
||||||
|
@media(max-width:820px){.nav-links{display:none}}
|
||||||
|
|
||||||
/* ── HERO ── */
|
.btn{
|
||||||
.hero { position: relative; overflow: hidden; padding: 78px 0 60px; }
|
display:inline-flex;align-items:center;justify-content:center;gap:8px;
|
||||||
.hero::before {
|
border:0;cursor:pointer;font:inherit;font-weight:600;border-radius:999px;
|
||||||
content: ""; position: absolute; inset: -30% -10% auto -10%; height: 620px;
|
transition:transform .16s ease,box-shadow .16s ease,background .16s ease;
|
||||||
background:
|
|
||||||
radial-gradient(42% 52% at 22% 18%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
|
|
||||||
radial-gradient(38% 48% at 78% 8%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 70%);
|
|
||||||
filter: blur(28px); pointer-events: none;
|
|
||||||
}
|
}
|
||||||
.hero .wrap { position: relative; text-align: center; }
|
.btn:hover{transform:translateY(-2px)}
|
||||||
.badge {
|
.btn-blue{
|
||||||
display: inline-flex; align-items: center; gap: 8px;
|
background:linear-gradient(96deg,var(--blue),var(--blue-d));color:#fff;
|
||||||
font-size: 13px; color: var(--fg-2);
|
padding:13px 30px;font-size:16px;box-shadow:0 10px 26px -10px rgba(58,123,252,.75);
|
||||||
border: 1px solid var(--card-b); background: var(--card);
|
|
||||||
padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
|
|
||||||
}
|
}
|
||||||
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
|
.btn-sm{padding:9px 22px;font-size:14.5px}
|
||||||
h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.12; margin: 0 0 16px; letter-spacing: -1px; }
|
.btn-line{background:#fff;color:var(--ink);border:1px solid var(--line);padding:13px 26px;font-size:16px}
|
||||||
h1 em {
|
.btn-line:hover{border-color:var(--blue-l);color:var(--blue)}
|
||||||
font-style: normal;
|
.btn-dark{background:#fff;color:var(--dark);padding:13px 30px;font-size:16px}
|
||||||
background: linear-gradient(100deg, var(--accent), var(--accent-2));
|
|
||||||
-webkit-background-clip: text; background-clip: text; color: transparent;
|
|
||||||
}
|
|
||||||
.lede { font-size: clamp(15px, 2.1vw, 18.5px); color: var(--fg-2); max-width: 620px; margin: 0 auto 34px; }
|
|
||||||
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
|
|
||||||
.btn {
|
|
||||||
display: inline-flex; align-items: center; gap: 9px;
|
|
||||||
padding: 13px 26px; border-radius: 12px; font-weight: 600; font-size: 15.5px;
|
|
||||||
border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease;
|
|
||||||
}
|
|
||||||
.btn:hover { transform: translateY(-1px); text-decoration: none; }
|
|
||||||
.btn-primary {
|
|
||||||
background: linear-gradient(100deg, var(--accent), var(--accent-2));
|
|
||||||
color: #fff; box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--accent) 75%, transparent);
|
|
||||||
}
|
|
||||||
.btn-ghost { border-color: var(--card-b); background: var(--card); color: var(--fg); }
|
|
||||||
.meta { margin-top: 18px; font-size: 13px; color: var(--fg-3); }
|
|
||||||
.meta span + span::before { content: "·"; margin: 0 9px; }
|
|
||||||
|
|
||||||
/* ── 应用外观示意 ── */
|
/* ───────── HERO ───────── */
|
||||||
.shot {
|
.kv{position:relative;background:var(--gray);padding:76px 0 0;overflow:hidden}
|
||||||
margin: 52px auto 0; max-width: 960px;
|
.kv::before,.kv::after{
|
||||||
border: 1px solid var(--card-b); border-radius: 14px; overflow: hidden;
|
content:"";position:absolute;border-radius:50%;filter:blur(70px);opacity:.55;pointer-events:none;
|
||||||
background: var(--bg-2); box-shadow: 0 40px 90px -50px rgba(0,0,0,.9);
|
|
||||||
}
|
}
|
||||||
.shot-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--card-b); }
|
.kv::before{width:520px;height:520px;left:-160px;top:-140px;background:radial-gradient(circle,#c9dcff,transparent 68%)}
|
||||||
.shot-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--card-b); }
|
.kv::after{width:560px;height:560px;right:-180px;top:-60px;background:radial-gradient(circle,#dbe8ff,transparent 70%)}
|
||||||
.shot-bar i:nth-child(1) { background: #ff5f57; } .shot-bar i:nth-child(2) { background: #febc2e; } .shot-bar i:nth-child(3) { background: #28c840; }
|
.kv-in{position:relative;text-align:center;z-index:1}
|
||||||
.shot-bar span { margin-left: 10px; font-size: 12.5px; color: var(--fg-3); }
|
.kv-tag{
|
||||||
.shot-body { display: grid; grid-template-columns: 168px 1fr 158px; min-height: 300px; }
|
display:inline-flex;align-items:center;gap:9px;background:#fff;border:1px solid var(--line);
|
||||||
@media (max-width: 760px) { .shot-body { grid-template-columns: 1fr; } .shot-side, .shot-out { display: none; } }
|
color:var(--ink-2);font-size:13.5px;padding:7px 16px;border-radius:999px;margin-bottom:26px;
|
||||||
.shot-side, .shot-out { padding: 14px 12px; font-size: 12.5px; color: var(--fg-3); border-right: 1px solid var(--card-b); }
|
box-shadow:0 4px 16px -8px rgba(20,30,60,.2);
|
||||||
.shot-out { border-right: 0; border-left: 1px solid var(--card-b); }
|
|
||||||
.shot-side b, .shot-out b { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; color: var(--fg-3); }
|
|
||||||
.shot-side div, .shot-out div { padding: 5px 8px; border-radius: 6px; margin-bottom: 3px; }
|
|
||||||
.shot-side div.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--fg); }
|
|
||||||
.shot-main { padding: 16px 20px; font: 13px/1.85 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--fg-2); }
|
|
||||||
.shot-main .h { color: var(--accent); font-weight: 700; }
|
|
||||||
.shot-main .hl { background: rgba(250, 204, 21, .28); border-radius: 3px; }
|
|
||||||
.shot-main .cur { background: rgba(249, 115, 22, .45); border-radius: 3px; }
|
|
||||||
|
|
||||||
/* ── 通用区块 ── */
|
|
||||||
section { padding: 72px 0; }
|
|
||||||
section + section { border-top: 1px solid var(--card-b); }
|
|
||||||
h2 { font-size: clamp(23px, 3.4vw, 31px); margin: 0 0 10px; letter-spacing: -.4px; }
|
|
||||||
.sub { color: var(--fg-2); margin: 0 0 36px; max-width: 640px; }
|
|
||||||
|
|
||||||
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
|
|
||||||
.card {
|
|
||||||
background: var(--card); border: 1px solid var(--card-b); border-radius: var(--radius);
|
|
||||||
padding: 22px; transition: border-color .15s ease, transform .15s ease;
|
|
||||||
}
|
}
|
||||||
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--card-b)); transform: translateY(-2px); }
|
.kv-tag b{color:var(--blue);font-weight:700}
|
||||||
.card h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 9px; }
|
.dot{width:7px;height:7px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.18)}
|
||||||
.card p { margin: 0; color: var(--fg-2); font-size: 14.5px; line-height: 1.65; }
|
h1{
|
||||||
.ico {
|
font-size:clamp(38px,5.6vw,68px);line-height:1.1;font-weight:800;letter-spacing:-1.5px;color:var(--ink);
|
||||||
width: 30px; height: 30px; border-radius: 9px; flex: none;
|
}
|
||||||
display: grid; place-items: center; font-size: 15px;
|
h1 em{
|
||||||
background: color-mix(in srgb, var(--accent) 16%, transparent);
|
font-style:normal;
|
||||||
|
background:linear-gradient(96deg,var(--blue),var(--blue-d));
|
||||||
|
-webkit-background-clip:text;background-clip:text;color:transparent;
|
||||||
|
}
|
||||||
|
.nw{white-space:nowrap}
|
||||||
|
.kv-sub{
|
||||||
|
margin:24px auto 0;max-width:720px;font-size:clamp(15px,1.7vw,19px);color:var(--ink-2);line-height:1.75;
|
||||||
|
}
|
||||||
|
.kv-meta{margin-top:20px;font-size:14.5px;color:var(--ink-3);display:flex;gap:0;justify-content:center;flex-wrap:wrap}
|
||||||
|
.kv-meta i{font-style:normal;padding:0 14px;border-right:1px solid var(--line)}
|
||||||
|
.kv-meta i:last-child{border:0}
|
||||||
|
.kv-cta{margin-top:34px;display:flex;gap:14px;justify-content:center;flex-wrap:wrap}
|
||||||
|
.kv-plat{margin-top:16px;font-size:13.5px;color:var(--ink-3)}
|
||||||
|
|
||||||
|
.badges{
|
||||||
|
margin:44px auto 0;display:flex;justify-content:center;gap:14px;flex-wrap:wrap;
|
||||||
|
max-width:900px;
|
||||||
|
}
|
||||||
|
.badge{
|
||||||
|
display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);
|
||||||
|
border-radius:999px;padding:9px 18px;font-size:14px;color:var(--ink-2);font-weight:500;
|
||||||
|
box-shadow:0 6px 20px -14px rgba(20,30,60,.4);
|
||||||
|
}
|
||||||
|
.badge b{color:var(--ink);font-weight:700}
|
||||||
|
.badge .tick{color:var(--blue);font-weight:800}
|
||||||
|
|
||||||
|
/* 应用外观 */
|
||||||
|
.shot{
|
||||||
|
position:relative;max-width:960px;margin:56px auto 0;
|
||||||
|
border-radius:18px 18px 0 0;background:#fff;border:1px solid var(--line);border-bottom:0;
|
||||||
|
box-shadow:var(--shadow-lg);overflow:hidden;text-align:left;
|
||||||
|
}
|
||||||
|
.shot-bar{display:flex;align-items:center;gap:8px;padding:13px 16px;border-bottom:1px solid var(--line);background:#fbfbfd}
|
||||||
|
.shot-bar i{width:11px;height:11px;border-radius:50%}
|
||||||
|
.shot-bar i:nth-child(1){background:#ff5f57}.shot-bar i:nth-child(2){background:#febc2e}.shot-bar i:nth-child(3){background:#28c840}
|
||||||
|
.shot-bar span{margin-left:12px;font-size:12.5px;color:var(--ink-3)}
|
||||||
|
|
||||||
|
/* 真实截图 */
|
||||||
|
.shot img,.dark-shot img{display:block;width:100%;height:auto}
|
||||||
|
.shot{border-radius:18px 18px 0 0}
|
||||||
|
.gal{display:grid;grid-template-columns:1fr 1fr;gap:22px}
|
||||||
|
@media(max-width:860px){.gal{grid-template-columns:1fr}}
|
||||||
|
.gal figure{
|
||||||
|
border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#fff;
|
||||||
|
box-shadow:var(--shadow);transition:.2s;
|
||||||
|
}
|
||||||
|
.gal figure:hover{box-shadow:var(--shadow-lg);transform:translateY(-3px)}
|
||||||
|
.gal img{display:block;width:100%;height:auto}
|
||||||
|
.gal figcaption{padding:16px 20px 18px;font-size:14.6px;color:var(--ink-2);line-height:1.65}
|
||||||
|
.gal figcaption b{display:block;color:var(--ink);font-size:15.5px;margin-bottom:4px}
|
||||||
|
|
||||||
|
/* 平台信息 */
|
||||||
|
.plat{margin:0 0 22px;background:#fff;border:1px solid var(--line);border-radius:16px;overflow:hidden}
|
||||||
|
.plat-row{display:flex;gap:18px;align-items:flex-start;padding:15px 22px;border-bottom:1px solid var(--line);font-size:14.6px;color:var(--ink-2);line-height:1.7}
|
||||||
|
.plat-row:last-child{border-bottom:0}
|
||||||
|
.plat-row b{flex:none;width:82px;color:var(--ink);font-weight:700}
|
||||||
|
.plat-chip{display:inline-block;background:var(--blue-bg);color:var(--blue-d);border-radius:999px;padding:3px 12px;font-size:13.5px;font-weight:600;margin:0 6px 6px 0}
|
||||||
|
@media(max-width:640px){.plat-row{flex-direction:column;gap:6px}.plat-row b{width:auto}}
|
||||||
|
|
||||||
|
/* ───────── 通用区块 ───────── */
|
||||||
|
section{padding:96px 0}
|
||||||
|
.sec-white{background:#fff}
|
||||||
|
.sec-gray{background:var(--gray)}
|
||||||
|
.sec-head{text-align:center;max-width:680px;margin:0 auto 54px}
|
||||||
|
.sec-head h2{font-size:clamp(26px,3.4vw,40px);font-weight:800;letter-spacing:-.8px;line-height:1.25}
|
||||||
|
.sec-head h2 em{font-style:normal;color:var(--blue)}
|
||||||
|
.sec-head p{margin-top:14px;color:var(--ink-2);font-size:16.5px}
|
||||||
|
|
||||||
|
/* 三大场景 */
|
||||||
|
.scene{
|
||||||
|
display:grid;grid-template-columns:1fr 1fr;gap:60px;align-items:center;
|
||||||
|
padding:44px 0;
|
||||||
|
}
|
||||||
|
.scene+.scene{border-top:1px solid var(--line)}
|
||||||
|
.scene.rev .scene-txt{order:2}
|
||||||
|
.scene-ico{display:inline-flex;align-items:center;gap:10px;font-size:14px;font-weight:600;color:var(--blue);margin-bottom:16px}
|
||||||
|
.scene-ico span{width:34px;height:34px;border-radius:11px;background:var(--blue-bg);display:grid;place-items:center;font-size:17px}
|
||||||
|
.scene h3{font-size:clamp(24px,2.6vw,32px);font-weight:800;line-height:1.3;letter-spacing:-.5px}
|
||||||
|
.scene ul{margin-top:24px;display:grid;gap:12px}
|
||||||
|
.scene li{display:flex;gap:11px;color:var(--ink-2);font-size:15.5px;line-height:1.6}
|
||||||
|
.scene li::before{content:"✓";color:var(--blue);font-weight:800;flex:none}
|
||||||
|
.scene-more{margin-top:26px;display:inline-flex;align-items:center;gap:7px;color:var(--blue);font-weight:600;font-size:15px}
|
||||||
|
.scene-visual{
|
||||||
|
border-radius:20px;background:linear-gradient(160deg,#f4f8ff,#eaf1ff);border:1px solid var(--line);
|
||||||
|
padding:26px;box-shadow:var(--shadow);min-height:230px;display:flex;flex-direction:column;gap:10px;justify-content:center;
|
||||||
|
}
|
||||||
|
.bar{height:11px;border-radius:6px;background:#fff;box-shadow:0 1px 2px rgba(20,30,60,.06)}
|
||||||
|
.bar.w80{width:80%}.w60{width:60%}.w70{width:70%}.w45{width:45%}.w90{width:90%}
|
||||||
|
.bar.blue{background:linear-gradient(90deg,var(--blue),var(--blue-l))}
|
||||||
|
.mini-tabs{display:flex;gap:8px;margin-bottom:6px}
|
||||||
|
.mini-tabs span{font-size:12px;padding:5px 12px;border-radius:999px;background:#fff;color:var(--ink-3);border:1px solid var(--line)}
|
||||||
|
.mini-tabs span.on{background:var(--blue);color:#fff;border-color:var(--blue)}
|
||||||
|
@media(max-width:880px){.scene{grid-template-columns:1fr;gap:30px}.scene.rev .scene-txt{order:0}}
|
||||||
|
|
||||||
|
/* 深色区块 */
|
||||||
|
.dark{background:var(--dark);color:#fff;position:relative;overflow:hidden}
|
||||||
|
.dark::before{content:"";position:absolute;width:700px;height:700px;right:-220px;top:-260px;
|
||||||
|
background:radial-gradient(circle,rgba(58,123,252,.28),transparent 70%);pointer-events:none}
|
||||||
|
.dark-in{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:70px;align-items:center}
|
||||||
|
.dark h2{font-size:clamp(28px,3.6vw,44px);font-weight:800;letter-spacing:-.6px;line-height:1.28}
|
||||||
|
.dark .lead{margin-top:16px;color:rgba(255,255,255,.66);font-size:16px}
|
||||||
|
.dark-list{margin-top:34px;display:grid;gap:2px}
|
||||||
|
.dark-list div{
|
||||||
|
display:flex;gap:16px;align-items:baseline;padding:15px 0;border-bottom:1px solid rgba(255,255,255,.1);
|
||||||
|
}
|
||||||
|
.dark-list div:last-child{border:0}
|
||||||
|
.dark-list b{font-size:16.5px;font-weight:700;flex:none;min-width:96px}
|
||||||
|
.dark-list span{color:rgba(255,255,255,.6);font-size:15px}
|
||||||
|
.dark-shot{
|
||||||
|
background:#1b1b1b;border:1px solid rgba(255,255,255,.12);border-radius:18px;overflow:hidden;
|
||||||
|
box-shadow:0 30px 80px -30px #000;
|
||||||
|
}
|
||||||
|
.dark-shot .shot-bar{background:#161616;border-bottom-color:rgba(255,255,255,.1)}
|
||||||
|
.dark-shot .shot-bar span{color:rgba(255,255,255,.4)}
|
||||||
|
@media(max-width:880px){.dark-in{grid-template-columns:1fr;gap:36px}}
|
||||||
|
|
||||||
|
/* 功能网格 */
|
||||||
|
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:18px}
|
||||||
|
.card{
|
||||||
|
background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:26px;
|
||||||
|
transition:.2s;position:relative;
|
||||||
|
}
|
||||||
|
.card:hover{border-color:var(--blue-l);box-shadow:var(--shadow);transform:translateY(-3px)}
|
||||||
|
.card h3{font-size:17px;font-weight:700;margin-bottom:9px;display:flex;align-items:center;gap:10px}
|
||||||
|
.card .ico{width:32px;height:32px;border-radius:10px;background:var(--blue-bg);color:var(--blue);display:grid;place-items:center;font-size:15px;flex:none}
|
||||||
|
.card p{color:var(--ink-2);font-size:14.8px;line-height:1.7}
|
||||||
|
code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em;background:var(--gray-2);padding:1.5px 6px;border-radius:5px;color:var(--blue-d)}
|
||||||
|
|
||||||
|
/* 快捷键 */
|
||||||
|
.keys{display:grid;grid-template-columns:1fr 1fr;gap:0 40px}
|
||||||
|
@media(max-width:760px){.keys{grid-template-columns:1fr}}
|
||||||
|
.key-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px 0;border-bottom:1px solid var(--line);font-size:15px}
|
||||||
|
.key-row>span:first-child{color:var(--ink-2)}
|
||||||
|
kbd{
|
||||||
|
font:12.5px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#fff;
|
||||||
|
border:1px solid var(--line);border-bottom-width:2px;border-radius:6px;padding:4px 7px;color:var(--ink);
|
||||||
|
display:inline-block;margin-left:4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
|
/* 下载 */
|
||||||
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--card-b); }
|
.dl-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px;margin-top:8px}
|
||||||
th { color: var(--fg-3); font-weight: 600; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
|
.dl-card{
|
||||||
td:first-child { color: var(--fg-2); }
|
background:#fff;border:1px solid var(--line);border-radius:18px;padding:30px;
|
||||||
kbd {
|
display:flex;flex-direction:column;transition:.2s;
|
||||||
font: 12.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
}
|
||||||
background: var(--card); border: 1px solid var(--card-b); border-bottom-width: 2px;
|
.dl-card.primary{border:2px solid var(--blue);box-shadow:0 20px 50px -30px rgba(58,123,252,.8);position:relative}
|
||||||
padding: 4px 7px; border-radius: 6px; color: var(--fg);
|
.dl-card.primary::after{
|
||||||
|
content:"推荐";position:absolute;top:-13px;left:30px;background:linear-gradient(96deg,var(--blue),var(--blue-d));
|
||||||
|
color:#fff;font-size:12px;font-weight:700;padding:4px 13px;border-radius:999px;
|
||||||
|
}
|
||||||
|
.dl-card h3{font-size:19px;font-weight:800;margin-bottom:8px}
|
||||||
|
.dl-size{font-size:14px;color:var(--ink-3);margin-bottom:14px}
|
||||||
|
.dl-card p{color:var(--ink-2);font-size:14.6px;line-height:1.7;flex:1;margin-bottom:22px}
|
||||||
|
.note-ic{flex:none;width:20px;height:20px;border-radius:50%;background:var(--blue);color:#fff;
|
||||||
|
font-size:12px;font-weight:800;font-style:italic;display:grid;place-items:center;margin-top:2px}
|
||||||
|
.note{
|
||||||
|
margin-top:26px;display:flex;gap:12px;align-items:flex-start;background:var(--blue-bg);
|
||||||
|
border-radius:14px;padding:16px 20px;font-size:14.6px;color:var(--blue-d)
|
||||||
}
|
}
|
||||||
.tbl-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
|
|
||||||
@media (max-width: 700px) { .tbl-2col { grid-template-columns: 1fr; } }
|
|
||||||
|
|
||||||
.callout {
|
footer{background:#fff;border-top:1px solid var(--line);padding:46px 0 56px;color:var(--ink-3);font-size:14px}
|
||||||
display: flex; gap: 14px; align-items: flex-start;
|
.foot{display:flex;gap:26px;flex-wrap:wrap;align-items:center}
|
||||||
background: var(--card); border: 1px solid var(--card-b); border-left: 3px solid var(--accent);
|
.foot a:hover{color:var(--blue)}
|
||||||
border-radius: 12px; padding: 16px 18px; margin-top: 22px; font-size: 14.5px; color: var(--fg-2);
|
.foot .sp{margin-left:auto}
|
||||||
}
|
.foot .sep{color:var(--line)}
|
||||||
footer { padding: 44px 0 60px; color: var(--fg-3); font-size: 13.5px; border-top: 1px solid var(--card-b); }
|
|
||||||
footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
|
|
||||||
footer .sp { margin-left: auto; }
|
|
||||||
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em;
|
|
||||||
background: var(--card); border: 1px solid var(--card-b); padding: 1px 6px; border-radius: 5px; }
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<header>
|
<header id="hd">
|
||||||
<div class="wrap">
|
<div class="wrap nav">
|
||||||
<span class="logo"><img src="/favicon.png" alt="">小银 Markdown</span>
|
<a class="brand" href="/"><img src="/favicon.png" alt="">小银 Markdown</a>
|
||||||
<nav>
|
<nav class="nav-links">
|
||||||
|
<a href="#scene">产品</a>
|
||||||
<a href="#features">功能</a>
|
<a href="#features">功能</a>
|
||||||
<a href="#shortcuts">快捷键</a>
|
<a href="#keys">快捷键</a>
|
||||||
<a href="#download">下载</a>
|
|
||||||
<a href="#about">关于</a>
|
<a href="#about">关于</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
<div class="nav-cta">
|
||||||
|
<a class="ghost" href="https://github.com/wangjinding/xiaoyin-markdown" target="_blank" rel="noopener">源码</a>
|
||||||
|
<a class="btn btn-blue btn-sm" href="#download">免费下载</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="hero">
|
<!-- ══════════ HERO ══════════ -->
|
||||||
<div class="wrap">
|
<div class="kv">
|
||||||
<span class="badge"><i class="dot"></i>v2.6.1 · Windows · 完全离线</span>
|
<div class="wrap kv-in">
|
||||||
<h1>写 Markdown,<em>安静一点</em></h1>
|
<div class="kv-tag"><i class="dot"></i><span>v<span data-ver>2.6.7</span> 已发布 · <b>支持在线升级</b></span></div>
|
||||||
<p class="lede">
|
<h1>写 Markdown,<br><em>就是好用!</em></h1>
|
||||||
一个纯本地的 Windows Markdown 编辑器。左边写、右边看,实时预览、多标签 / 多窗口、
|
<p class="kv-sub">
|
||||||
章节大纲、查找高亮。不联网、不登录、不收集任何数据。
|
一个纯本地的 Markdown 编辑器,<span class="nw">Windows / macOS / Linux</span> <b class="nw">三端同源</b>。<br>
|
||||||
|
左边写、右边看,实时预览、多标签、章节大纲、查找高亮,打开就能写。
|
||||||
</p>
|
</p>
|
||||||
<div class="cta">
|
<div class="kv-meta">
|
||||||
<a class="btn btn-primary" href="#download">↓ 下载 Windows 版</a>
|
<i>基础功能全免费</i><i>不联网 · 不登录</i><i>不收集任何数据</i>
|
||||||
<a class="btn btn-ghost" href="https://github.com/wangjinding/xiaoyin-markdown" target="_blank" rel="noopener">查看源码</a>
|
|
||||||
</div>
|
</div>
|
||||||
<p class="meta">
|
<div class="kv-cta">
|
||||||
<span>Windows 10 / 11 · x64</span><span>免安装便携版</span><span>MIT 开源</span>
|
<a class="btn btn-blue" data-dl="setup" href="/download/latest-setup.exe" download>↓ 免费下载</a>
|
||||||
</p>
|
<a class="btn btn-line" href="#scene">看看功能</a>
|
||||||
|
</div>
|
||||||
|
<p class="kv-plat">Windows 10/11 · macOS 11+ · Linux x86_64 · 支持在线升级</p>
|
||||||
|
|
||||||
<div class="shot" aria-hidden="true">
|
<div class="badges">
|
||||||
<div class="shot-bar"><i></i><i></i><i></i><span>未命名 — 小银 Markdown</span></div>
|
<div class="badge"><span class="tick">✓</span>纯本地运行</div>
|
||||||
<div class="shot-body">
|
<div class="badge"><span class="tick">✓</span>三端同源</div>
|
||||||
<div class="shot-side">
|
<div class="badge"><span class="tick">✓</span>零依赖渲染引擎</div>
|
||||||
<b>目录</b>
|
<div class="badge"><span class="tick">✓</span>无账号 · 无遥测</div>
|
||||||
<div class="on">README.md</div>
|
<div class="badge"><span class="tick">✓</span>MIT 开源</div>
|
||||||
<div>notes.md</div>
|
|
||||||
<div>todo.txt</div>
|
|
||||||
</div>
|
|
||||||
<div class="shot-main">
|
|
||||||
<span class="h"># 小银 Markdown</span>
|
|
||||||
纯本地的编辑器,<span class="hl">左边写</span>、<span class="hl">右边看</span>。
|
|
||||||
<br><br>
|
|
||||||
<span class="h">## 功能</span>
|
|
||||||
- 实时预览:编辑 / 分栏 / 阅读<span class="cur">|</span>
|
|
||||||
- 多标签 · 多窗口
|
|
||||||
- 章节大纲 · 查找高亮
|
|
||||||
</div>
|
|
||||||
<div class="shot-out">
|
|
||||||
<b>大纲</b>
|
|
||||||
<div>小银 Markdown</div>
|
|
||||||
<div>功能</div>
|
|
||||||
<div>快捷键</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="shot">
|
||||||
|
<div class="shot-bar"><i></i><i></i><i></i><span>周报-2026-11-19.md — 小银 Markdown</span></div>
|
||||||
|
<img src="/img/app-light.jpg" width="1600" height="1000" decoding="async"
|
||||||
|
alt="小银 Markdown 主界面:左侧文件树、中间 Markdown 源码、右侧实时预览与章节大纲">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section id="features">
|
<!-- ══════════ 三大场景 ══════════ -->
|
||||||
|
<section id="scene" class="sec-white">
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2>该有的都有,不该有的一个没有</h2>
|
<div class="sec-head">
|
||||||
<p class="sub">没有账号、没有云同步、没有遥测。打开就能写,关掉就结束。</p>
|
<h2>一个编辑器,<em>覆盖三种用法</em></h2>
|
||||||
|
<p>不用开一堆 App。写笔记、整理文档、记技术细节,都是同一个窗口。</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="scene">
|
||||||
|
<div class="scene-txt">
|
||||||
|
<div class="scene-ico"><span>✎</span>日常写作</div>
|
||||||
|
<h3>即开即写,<br>预览就在右边</h3>
|
||||||
|
<ul>
|
||||||
|
<li>编辑 / 分栏 / 阅读三种视图,分栏宽度可拖动</li>
|
||||||
|
<li>深色 / 浅色主题,字号缩放,状态都记住</li>
|
||||||
|
<li>状态栏显示字数、字符数、光标行列</li>
|
||||||
|
<li>自动保留原文件的换行符(CRLF / LF)</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="scene-visual">
|
||||||
|
<div class="mini-tabs"><span class="on">分栏</span><span>编辑</span><span>阅读</span></div>
|
||||||
|
<div class="bar blue w45"></div>
|
||||||
|
<div class="bar w90"></div>
|
||||||
|
<div class="bar w80"></div>
|
||||||
|
<div class="bar w60"></div>
|
||||||
|
<div class="bar blue w45" style="margin-top:6px"></div>
|
||||||
|
<div class="bar w70"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="scene rev">
|
||||||
|
<div class="scene-txt">
|
||||||
|
<div class="scene-ico"><span>▤</span>文档整理</div>
|
||||||
|
<h3>左侧文件树,<br>像资源管理器一样顺手</h3>
|
||||||
|
<ul>
|
||||||
|
<li>列出当前文件夹里的 Markdown / 文本文件</li>
|
||||||
|
<li>单击只选中、双击才打开,文件夹双击展开</li>
|
||||||
|
<li>右键「复制文件」拿到的是<b>文件本身</b>,能直接粘到微信</li>
|
||||||
|
<li>记住上次打开的文件夹,下次直接续上</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="scene-visual">
|
||||||
|
<div class="bar w60 blue"></div>
|
||||||
|
<div class="bar w45"></div>
|
||||||
|
<div class="bar w70"></div>
|
||||||
|
<div class="bar w45"></div>
|
||||||
|
<div class="bar w60"></div>
|
||||||
|
<div class="bar w80" style="margin-top:8px"></div>
|
||||||
|
<div class="bar w90"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="scene">
|
||||||
|
<div class="scene-txt">
|
||||||
|
<div class="scene-ico"><span>#</span>技术笔记</div>
|
||||||
|
<h3>章节大纲 +<br>查找高亮,长文不迷路</h3>
|
||||||
|
<ul>
|
||||||
|
<li>按标题自动生成章节树,点一条跳转</li>
|
||||||
|
<li>滚动时自动高亮当前章节,实时更新</li>
|
||||||
|
<li><code>Ctrl+F</code> 查找,所有命中标黄、当前标橙并滚到可视区</li>
|
||||||
|
<li>代码块、表格(含对齐)、任务列表都支持</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="scene-visual">
|
||||||
|
<div class="bar w45 blue"></div>
|
||||||
|
<div class="bar w80"></div>
|
||||||
|
<div class="bar w70"></div>
|
||||||
|
<div class="bar w45 blue" style="margin-top:6px"></div>
|
||||||
|
<div class="bar w90"></div>
|
||||||
|
<div class="bar w60"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- ══════════ 深色:干净无广 ══════════ -->
|
||||||
|
<section class="dark">
|
||||||
|
<div class="wrap dark-in">
|
||||||
|
<div>
|
||||||
|
<h2>功能强大,<br>干净无广</h2>
|
||||||
|
<p class="lead">没有开屏广告、没有会员弹窗、没有后台常驻服务。装完就是一个编辑器。</p>
|
||||||
|
<div class="dark-list">
|
||||||
|
<div><b>全新安装包</b><span>Tauri + 系统 WebView2,免装运行时,秒装</span></div>
|
||||||
|
<div><b>多标签多窗口</b><span>切换时正文、滚动位置、光标都跟着迁移</span></div>
|
||||||
|
<div><b>操控自如</b><span>快捷键覆盖新建到全屏,<code>Tab</code> 缩进、列表自动续行</span></div>
|
||||||
|
<div><b>隐私优先</b><span>不联网、不登录、不收集;只读写你主动打开的文件</span></div>
|
||||||
|
<div><b>拖进来就开</b><span>拖 <code>.md</code> 打开文件,拖文件夹展开目录</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dark-shot">
|
||||||
|
<div class="shot-bar"><i></i><i></i><i></i><span>深色主题 · 周报-2026-11-19.md</span></div>
|
||||||
|
<img src="/img/app-dark.jpg" width="1600" height="1000" loading="lazy" decoding="async"
|
||||||
|
alt="小银 Markdown 深色主题">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- ══════════ 功能网格 ══════════ -->
|
||||||
|
<section id="features" class="sec-white">
|
||||||
|
<div class="wrap">
|
||||||
|
<div class="sec-head">
|
||||||
|
<h2>该有的都有,<em>不该有的一个没有</em></h2>
|
||||||
|
<p>没有账号、没有云同步、没有遥测。打开就能写,关掉就结束。</p>
|
||||||
|
</div>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div class="card">
|
<div class="card"><h3><span class="ico">◧</span>实时预览</h3><p>编辑 / 分栏 / 阅读三种模式,分栏宽度可拖动;渲染前转义 HTML,链接交给系统浏览器。</p></div>
|
||||||
<h3><span class="ico">◧</span>实时预览</h3>
|
<div class="card"><h3><span class="ico">▤</span>多标签 · 多窗口</h3><p>一个窗口切多个文档,或每篇一个独立窗口。切换时未保存的正文、滚动位置、光标都跟着走。</p></div>
|
||||||
<p>编辑 / 分栏 / 阅读三种模式,分栏宽度可拖动;渲染前转义 HTML,链接交给系统浏览器打开。</p>
|
<div class="card"><h3><span class="ico">☰</span>左侧文件目录</h3><p>列出当前文件夹的 Markdown / 文本文件,单击选中、双击打开,跟资源管理器一致。</p></div>
|
||||||
|
<div class="card"><h3><span class="ico">⌗</span>右侧章节大纲</h3><p>按标题自动生成章节树,点一条跳转;随编辑实时更新,滚动时高亮当前章节。</p></div>
|
||||||
|
<div class="card"><h3><span class="ico">⌕</span>查找与高亮</h3><p><kbd>Ctrl</kbd>+<kbd>F</kbd> 打开查找条,命中标黄、当前标橙并自动滚到可视区。</p></div>
|
||||||
|
<div class="card"><h3><span class="ico">⧉</span>复制文件本身</h3><p>右键「复制文件」= Win32 <code>SetClipboardData(CF_HDROP)</code>,剪贴板里是文件,能粘到资源管理器或微信。</p></div>
|
||||||
|
<div class="card"><h3><span class="ico">↓</span>拖进来就打开</h3><p>把 <code>.md</code> 拖进窗口直接打开;把文件夹拖进来,左侧列出该目录。</p></div>
|
||||||
|
<div class="card"><h3><span class="ico">◐</span>深色 / 浅色</h3><p>两套主题、字号缩放、面板宽度与开关状态全部记住,重启后原样恢复。</p></div>
|
||||||
|
<div class="card"><h3><span class="ico">✓</span>完整渲染</h3><p>标题、粗体斜体删除线、行内代码、代码块、引用、嵌套列表、任务列表、表格(含对齐)、分割线、链接、图片。</p></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
|
||||||
<h3><span class="ico">▤</span>多标签 · 多窗口</h3>
|
|
||||||
<p>「标签」模式一个窗口切多个文档,「独立窗口」模式每篇一个窗口。切换时正文、滚动位置、光标都跟着迁移,不会丢。</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
</section>
|
||||||
<h3><span class="ico">☰</span>左侧文件目录</h3>
|
|
||||||
<p>列出当前文件夹里的 Markdown / 文本文件。单击选中、双击打开,跟资源管理器一致;记住上次打开的文件夹。</p>
|
<!-- ══════════ 快捷键 ══════════ -->
|
||||||
|
<section id="keys" class="sec-gray">
|
||||||
|
<div class="wrap">
|
||||||
|
<div class="sec-head">
|
||||||
|
<h2>常用的都顺手</h2>
|
||||||
|
<p>不常用的也不占地方 —— 完整列表见仓库 README。</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="keys">
|
||||||
<h3><span class="ico">⌗</span>右侧章节大纲</h3>
|
<div>
|
||||||
<p>按标题自动生成章节树,点一条跳转;随编辑实时更新,滚动时高亮当前章节。</p>
|
<div class="key-row"><span>新建 / 打开</span><span><kbd>Ctrl</kbd><kbd>N</kbd><kbd>O</kbd></span></div>
|
||||||
|
<div class="key-row"><span>保存 / 另存为</span><span><kbd>Ctrl</kbd><kbd>S</kbd><kbd>Shift</kbd></span></div>
|
||||||
|
<div class="key-row"><span>撤销 / 重做</span><span><kbd>Ctrl</kbd><kbd>Z</kbd><kbd>Y</kbd></span></div>
|
||||||
|
<div class="key-row"><span>查找</span><span><kbd>Ctrl</kbd><kbd>F</kbd></span></div>
|
||||||
|
<div class="key-row"><span>复制全文</span><span><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>C</kbd></span></div>
|
||||||
|
<div class="key-row"><span>打开文件夹</span><span><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>K</kbd></span></div>
|
||||||
|
<div class="key-row"><span>在新窗口打开</span><span><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>N</kbd></span></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div>
|
||||||
<h3><span class="ico">⌕</span>查找与高亮</h3>
|
<div class="key-row"><span>文件目录 / 大纲</span><span><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>B</kbd><kbd>T</kbd></span></div>
|
||||||
<p><kbd>Ctrl+F</kbd> 打开查找条,正文里所有命中标黄、当前命中标橙并自动滚到可视区,编辑时实时恢复。</p>
|
<div class="key-row"><span>编辑 / 分栏 / 阅读</span><span><kbd>Ctrl</kbd><kbd>1</kbd><kbd>2</kbd><kbd>3</kbd></span></div>
|
||||||
</div>
|
<div class="key-row"><span>深色浅色切换</span><span><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>L</kbd></span></div>
|
||||||
<div class="card">
|
<div class="key-row"><span>放大 / 缩小 / 还原</span><span><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>=</kbd><kbd>0</kbd></span></div>
|
||||||
<h3><span class="ico">⧉</span>复制文件本身</h3>
|
<div class="key-row"><span>资源管理器中显示</span><span><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>O</kbd></span></div>
|
||||||
<p>右键「复制文件」=调用 Win32 <code>SetClipboardData(CF_HDROP)</code>,剪贴板里是文件,能直接粘到资源管理器或微信。</p>
|
<div class="key-row"><span>全屏 / 开发者工具</span><span><kbd>F11</kbd><kbd>F12</kbd></span></div>
|
||||||
</div>
|
<div class="key-row"><span>复制选中的文件</span><span><kbd>Ctrl</kbd><kbd>C</kbd></span></div>
|
||||||
<div class="card">
|
|
||||||
<h3><span class="ico">↓</span>拖进来就打开</h3>
|
|
||||||
<p>把 <code>.md</code> 文件拖进窗口直接打开;把文件夹拖进来,左侧列出该目录。</p>
|
|
||||||
</div>
|
|
||||||
<div class="card">
|
|
||||||
<h3><span class="ico">◐</span>深色 / 浅色</h3>
|
|
||||||
<p>两套主题、字号缩放、面板宽度与开关状态全部记住,重启后原样恢复。</p>
|
|
||||||
</div>
|
|
||||||
<div class="card">
|
|
||||||
<h3><span class="ico">✓</span>完整渲染</h3>
|
|
||||||
<p>标题、粗体斜体删除线、行内代码、代码块、引用、嵌套列表、任务列表、表格(含对齐)、分割线、链接、图片。</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="shortcuts">
|
<!-- ══════════ 真实界面 ══════════ -->
|
||||||
|
<section id="gallery" class="sec-white">
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2>快捷键</h2>
|
<div class="sec-head">
|
||||||
<p class="sub">常用的都顺手,不常用的也不占地方。</p>
|
<h2>这些<em>都是真实界面</em></h2>
|
||||||
<div class="tbl-2col">
|
<p>不是效果图 —— 就是把程序跑起来截的,一张没修。</p>
|
||||||
<table>
|
</div>
|
||||||
<tr><td>新建 / 打开</td><td><kbd>Ctrl</kbd>+<kbd>N</kbd> / <kbd>Ctrl</kbd>+<kbd>O</kbd></td></tr>
|
<div class="gal">
|
||||||
<tr><td>保存 / 另存为</td><td><kbd>Ctrl</kbd>+<kbd>S</kbd> / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd></td></tr>
|
<figure>
|
||||||
<tr><td>撤销 / 重做</td><td><kbd>Ctrl</kbd>+<kbd>Z</kbd> / <kbd>Ctrl</kbd>+<kbd>Y</kbd></td></tr>
|
<img src="/img/app-find.jpg" width="1600" height="1000" loading="lazy" decoding="async"
|
||||||
<tr><td>查找</td><td><kbd>Ctrl</kbd>+<kbd>F</kbd></td></tr>
|
alt="查找功能:正文中所有命中标黄、当前命中标橙,右侧预览同步高亮">
|
||||||
<tr><td>复制全文</td><td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>C</kbd></td></tr>
|
<figcaption><b>查找与高亮</b>正文里所有命中标黄、当前命中标橙,并自动滚到可视区;计数在右上角</figcaption>
|
||||||
<tr><td>打开文件夹</td><td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>K</kbd></td></tr>
|
</figure>
|
||||||
<tr><td>在新窗口打开</td><td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>N</kbd></td></tr>
|
<figure>
|
||||||
</table>
|
<img src="/img/app-read.jpg" width="1600" height="1000" loading="lazy" decoding="async"
|
||||||
<table>
|
alt="阅读模式:隐藏编辑区,只保留排版后的正文">
|
||||||
<tr><td>文件目录 / 大纲</td><td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd> / <kbd>T</kbd></td></tr>
|
<figcaption><b>阅读模式</b>收起编辑区只留正文,长文按排版稿看,章节大纲随时跳转</figcaption>
|
||||||
<tr><td>编辑 / 分栏 / 阅读</td><td><kbd>Ctrl</kbd>+<kbd>1</kbd> / <kbd>2</kbd> / <kbd>3</kbd></td></tr>
|
</figure>
|
||||||
<tr><td>深色浅色切换</td><td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>L</kbd></td></tr>
|
|
||||||
<tr><td>放大 / 缩小 / 还原</td><td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>=</kbd> / <kbd>-</kbd> / <kbd>Ctrl</kbd>+<kbd>0</kbd></td></tr>
|
|
||||||
<tr><td>资源管理器中显示</td><td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>O</kbd></td></tr>
|
|
||||||
<tr><td>全屏 / 开发者工具</td><td><kbd>F11</kbd> / <kbd>F12</kbd></td></tr>
|
|
||||||
<tr><td>复制选中的文件</td><td><kbd>Ctrl</kbd>+<kbd>C</kbd>(焦点在条目上)</td></tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="download">
|
<!-- ══════════ 下载 ══════════ -->
|
||||||
|
<section id="download" class="sec-white">
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2>下载</h2>
|
<div class="sec-head">
|
||||||
<p class="sub">免安装,解压即用。程序只读写你主动打开或保存的文件,不联网。</p>
|
<h2>下载,<em>装完就能用</em></h2>
|
||||||
<div class="grid">
|
<p>安装版装好后,双击 .md 就直接用小银 Markdown 打开。</p>
|
||||||
<div class="card">
|
|
||||||
<h3><span class="ico">↓</span>Windows 便携版</h3>
|
|
||||||
<p style="margin-bottom:14px">x64 · Windows 10 / 11 · 解压到任意目录,双击 <code>XiaoyinMarkdown.exe</code> 运行。</p>
|
|
||||||
<a class="btn btn-primary" href="/download/XiaoyinMarkdown-win32-x64.zip" download>下载 .zip</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="dl-grid">
|
||||||
<h3><span class="ico">⌥</span>其它方式</h3>
|
<div class="dl-card primary">
|
||||||
<p style="margin-bottom:14px">源码在 Gitea / GitHub,可自行打包;也可以只把 exe 覆盖到已有目录升级。</p>
|
<h3>安装版</h3>
|
||||||
<a class="btn btn-ghost" href="https://github.com/wangjinding/xiaoyin-markdown" target="_blank" rel="noopener">GitHub 仓库</a>
|
<div class="dl-size">Windows 10 / 11 · x64 · 安装包</div>
|
||||||
<a class="btn btn-ghost" href="https://git.wangjinding.com/Jidekin/xiaoyin-markdown" target="_blank" rel="noopener">Gitea 仓库</a>
|
<p>
|
||||||
</div>
|
装完 <b>双击 .md 默认用它打开</b>(.markdown / .mdown / .mkd / .mdwn 同理),
|
||||||
</div>
|
开始菜单有快捷方式,可在「设置 → 应用」里正常卸载。
|
||||||
<div class="callout">
|
|
||||||
<span>ℹ️</span>
|
|
||||||
<div>未做代码签名,首次运行 Windows SmartScreen 可能提示「未知发布者」,点「更多信息 → 仍要运行」即可。</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section id="about">
|
|
||||||
<div class="wrap">
|
|
||||||
<h2>关于</h2>
|
|
||||||
<p class="sub">
|
|
||||||
小银 Markdown 是一个纯本地的 Windows 桌面编辑器,界面用 Electron + 自写的零依赖 Markdown 渲染引擎,
|
|
||||||
桌面能力(剪贴板文件、快捷方式等)通过 <code>koffi</code> 直接调用 Win32 API。
|
|
||||||
另有一套 Tauri 2 的桌面壳在 <code>src-tauri/</code>,可按需切换。
|
|
||||||
</p>
|
</p>
|
||||||
|
<a class="btn btn-blue" data-dl="setup" href="/download/latest-setup.exe" download>下载安装包 .exe</a>
|
||||||
|
</div>
|
||||||
|
<div class="dl-card">
|
||||||
|
<h3>免安装版</h3>
|
||||||
|
<div class="dl-size">单个 exe · 免安装</div>
|
||||||
|
<p>
|
||||||
|
放哪都能跑,<b>不写注册表、不改文件关联</b>。适合放 U 盘,或不想在系统里留痕迹的时候。
|
||||||
|
</p>
|
||||||
|
<a class="btn btn-line" data-dl="portable" href="/download/latest-portable.exe" download>下载便携版 .exe</a>
|
||||||
|
</div>
|
||||||
|
<div class="dl-card" data-plat="mac" hidden>
|
||||||
|
<h3>macOS</h3>
|
||||||
|
<div class="dl-size">.dmg · Apple Silicon / Intel</div>
|
||||||
|
<p>
|
||||||
|
拖进「应用程序」即可。未做苹果开发者签名,首次打开需<b>右键 → 打开</b>(或
|
||||||
|
在终端执行 <code>xattr -dr com.apple.quarantine /Applications/XiaoyinMarkdown.app</code>)。
|
||||||
|
</p>
|
||||||
|
<a class="btn btn-line" data-dl="mac-arm" href="/download/latest-setup.exe" download>Apple Silicon</a>
|
||||||
|
<a class="btn btn-line" data-dl="mac-x64" href="/download/latest-setup.exe" download style="margin-top:8px">Intel</a>
|
||||||
|
</div>
|
||||||
|
<div class="dl-card" data-plat="linux" hidden>
|
||||||
|
<h3>Linux</h3>
|
||||||
|
<div class="dl-size">AppImage / deb · x86_64</div>
|
||||||
|
<p>
|
||||||
|
AppImage 免安装,<code>chmod +x</code> 后双击即可;deb 适合 Debian / Ubuntu 系。
|
||||||
|
需要系统里有 WebKitGTK 4.1。
|
||||||
|
</p>
|
||||||
|
<a class="btn btn-line" data-dl="linux-appimage" href="/download/latest-setup.exe" download>AppImage</a>
|
||||||
|
<a class="btn btn-line" data-dl="linux-deb" href="/download/latest-setup.exe" download style="margin-top:8px">.deb</a>
|
||||||
|
</div>
|
||||||
|
<div class="dl-card">
|
||||||
|
<h3>源码 / 旧版</h3>
|
||||||
|
<div class="dl-size">Gitea · GitHub</div>
|
||||||
|
<p>
|
||||||
|
源码在两个仓库,<code>npx tauri build</code> 即可自行打包。
|
||||||
|
旧版 Electron 构建(自带运行时,体积大得多)也还在。
|
||||||
|
</p>
|
||||||
|
<a class="btn btn-line" href="https://github.com/wangjinding/xiaoyin-markdown" target="_blank" rel="noopener">去 GitHub</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="note">
|
||||||
|
<span class="note-ic">i</span>
|
||||||
|
<div>三个平台都<b>未做代码签名</b>:Windows 首次运行会提示「未知发布者」,点「更多信息 → 仍要运行」;macOS 需<b>右键 → 打开</b>(或在终端执行 <code>xattr -dr com.apple.quarantine /Applications/XiaoyinMarkdown.app</code>)。Windows 10 若缺 WebView2,安装程序会自动下载。</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- ══════════ 关于 ══════════ -->
|
||||||
|
<section id="about" class="sec-gray">
|
||||||
|
<div class="wrap">
|
||||||
|
<div class="sec-head">
|
||||||
|
<h2>关于<em>小银 Markdown</em></h2>
|
||||||
|
<p>
|
||||||
|
Rust + Tauri 2,界面是同一套自写的零依赖 Markdown 渲染引擎 ——
|
||||||
|
Windows / macOS / Linux <b>三端同源</b>:一份渲染代码、一套快捷键、一致的界面。
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="plat">
|
||||||
|
<div class="plat-row">
|
||||||
|
<b>支持平台</b>
|
||||||
|
<span>
|
||||||
|
<span class="plat-chip">Windows 10 / 11 x64</span>
|
||||||
|
<span class="plat-chip">macOS 11+ · Apple Silicon / Intel</span>
|
||||||
|
<span class="plat-chip">Linux x86_64 · AppImage / deb</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="plat-row">
|
||||||
|
<b>在线升级</b>
|
||||||
|
<span>软件内点状态栏右下角「检查更新」→ 下载 → 校验签名 → 覆盖安装 → 自动重启。</span>
|
||||||
|
</div>
|
||||||
|
<div class="plat-row">
|
||||||
|
<b>平台差异</b>
|
||||||
|
<span>文件树右键「复制文件」:Windows 复制的是<b>文件本身</b>(能直接粘到资源管理器 / 微信);
|
||||||
|
macOS 与 Linux 的系统剪贴板没有通用文件格式,退化为复制<b>路径文本</b>。
|
||||||
|
「在文件管理器中显示」三端都支持。</span>
|
||||||
|
</div>
|
||||||
|
<div class="plat-row">
|
||||||
|
<b>体积</b>
|
||||||
|
<span>Windows 安装包约 2 MB、Linux deb 约 3 MB(用系统 WebView);AppImage 与 dmg 为了免依赖
|
||||||
|
会自带运行时,会大很多。</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div class="card">
|
<div class="card"><h3><span class="ico">✓</span>隐私</h3><p>不联网、不登录、不收集数据。唯一的网络行为是你点预览里的外部链接,以及手动点「检查更新」。</p></div>
|
||||||
<h3><span class="ico">✓</span>隐私</h3>
|
<div class="card"><h3><span class="ico">⚖</span>许可</h3><p>MIT License,可自由使用、修改、分发。</p></div>
|
||||||
<p>不联网、不登录、不收集数据。唯一的网络行为是你点击预览里的外部链接时,交给系统浏览器打开。</p>
|
<div class="card"><h3><span class="ico">⌨</span>自己改</h3><p>克隆仓库后 <code>npm install</code> 再 <code>npm start</code>;三端打包见 README 的「三端支持」。</p></div>
|
||||||
</div>
|
|
||||||
<div class="card">
|
|
||||||
<h3><span class="ico">⚖</span>许可</h3>
|
|
||||||
<p>MIT License,可自由使用、修改、分发。</p>
|
|
||||||
</div>
|
|
||||||
<div class="card">
|
|
||||||
<h3><span class="ico">⌨</span>自己改</h3>
|
|
||||||
<p>克隆仓库后 <code>npm install</code> 再 <code>npm start</code>;打包见 README 的「重新打包 exe」。</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<div class="wrap">
|
<div class="wrap foot">
|
||||||
<span>© 2026 小银 · 小银 Markdown v2.6.1</span>
|
<span>© 2026 小银 · 小银 Markdown v<span data-ver>2.6.7</span> · MIT</span>
|
||||||
<span class="sp"><a href="https://github.com/wangjinding/xiaoyin-markdown" target="_blank" rel="noopener">GitHub</a></span>
|
<span class="sp"></span>
|
||||||
<span><a href="https://git.wangjinding.com/Jidekin/xiaoyin-markdown" target="_blank" rel="noopener">Gitea</a></span>
|
<a href="https://github.com/wangjinding/xiaoyin-markdown" target="_blank" rel="noopener">GitHub</a>
|
||||||
|
<span class="sep">|</span>
|
||||||
|
<a href="https://git.wangjinding.com/Jidekin/xiaoyin-markdown" target="_blank" rel="noopener">Gitea</a>
|
||||||
|
<span class="sep">|</span>
|
||||||
|
<a href="#download">下载</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 滚动时给导航加分隔线(UU 官网那种"浮起"感)
|
||||||
|
const hd = document.getElementById('hd');
|
||||||
|
const onScroll = () => hd.classList.toggle('on', window.scrollY > 8);
|
||||||
|
window.addEventListener('scroll', onScroll, { passive: true });
|
||||||
|
onScroll();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 版本号/下载链接跟随 /update/latest.json —— 以后发版不用手改页面
|
||||||
|
fetch('/update/latest.json', { cache: 'no-store' })
|
||||||
|
.then((r) => (r.ok ? r.json() : null))
|
||||||
|
.then((m) => {
|
||||||
|
if (!m || !m.version) return;
|
||||||
|
document.querySelectorAll('[data-ver]').forEach((el) => { el.textContent = m.version; });
|
||||||
|
document.querySelectorAll('[data-notes]').forEach((el) => { el.textContent = m.notes || ''; });
|
||||||
|
// 下载文件名带版本号:xymd_2.6.2.exe / xymd_2.6.2_portable.exe
|
||||||
|
const map = {
|
||||||
|
setup: `xymd_${m.version}.exe`,
|
||||||
|
portable: `xymd_${m.version}_portable.exe`,
|
||||||
|
'mac-arm': `xymd_${m.version}_aarch64.dmg`,
|
||||||
|
'mac-x64': `xymd_${m.version}_x64.dmg`,
|
||||||
|
'linux-appimage': `xymd_${m.version}_amd64.AppImage`,
|
||||||
|
'linux-deb': `xymd_${m.version}_amd64.deb`,
|
||||||
|
};
|
||||||
|
Object.entries(map).forEach(([kind, name]) => {
|
||||||
|
document.querySelectorAll(`[data-dl="${kind}"]`).forEach((a) => {
|
||||||
|
a.setAttribute('href', `/download/${name}`);
|
||||||
|
a.setAttribute('download', name);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// 清单里出现哪个平台,才显示那张下载卡(没构建过就不显示,避免 404)
|
||||||
|
const plats = Object.keys(m.platforms || {});
|
||||||
|
const has = (p) => plats.some((k) => k === p || k.startsWith(p));
|
||||||
|
document.querySelectorAll('[data-plat]').forEach((el) => {
|
||||||
|
const ok = el.dataset.plat === 'mac' ? has('darwin') : has('linux');
|
||||||
|
el.hidden = !ok;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"version": "2.6.7",
|
||||||
|
"notes": "① 官网改为 xymd.wangjinding.com,旧域名已彻底下线\n② 软件内「检查更新」只连新地址(旧的兜底地址已移除)\n③ 没有功能变化",
|
||||||
|
"pub_date": "2026-11-20T07:18:19Z",
|
||||||
|
"platforms": {
|
||||||
|
"windows-x86_64": {
|
||||||
|
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSWWkrQjVjQnNqN3NRTEZtMm13Yyt2VklWaytPc0FvSzlWdHNpOHlqeUpWeHZiM3FJakJlTUh1NUlKbUM0aGpZTEs5My9lTEthdzhsTy9EblJpRUJZcDJDRURtN3c2YUE4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk1MTU4Nzk2CWZpbGU6WGlhb3lpbk1hcmtkb3duXzIuNi43X3g2NC1zZXR1cC5leGUJdmVyc2lvbjoyLjYuNwpBUU9OT241MUFLcnRqRXB6Q1RQRERNTXdDNTZDTUlrN2xULzQ2MitXYWVsRmo3dFA1S2Z6WXRWRTR2a1JNOUtkYmFHbU5KRGllYk54eWFSR2JTR3VEZz09Cg==",
|
||||||
|
"url": "https://xymd.wangjinding.com/download/xymd_2.6.7.exe",
|
||||||
|
"size": 2267038,
|
||||||
|
"sha256": "f79909df58ea1c3dce666eca25f2eb62898a787af6e2acfe3576f60813dcaaf9"
|
||||||
|
},
|
||||||
|
"linux-x86_64": {
|
||||||
|
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSWWkrQjVjQnNqN2sxemFOS0orTjU1clJtOE9jeXIrcWdtMTFrZnRNZUJTaTkyb1RPbWF1cHZkVi9CK3A4eVVTdmpnbkdXNXZEL25QK0puSTQrMTFGSnVnOHdiUnBHUWdZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk1MTU5MDc5CWZpbGU6WGlhb3lpbk1hcmtkb3duXzIuNi43X2FtZDY0LkFwcEltYWdlCXZlcnNpb246Mi42LjcKakgzakpsM3ZNOGFwUEZjaGxvbUdFSE82ZnVGNjdQSXNMVC9rUzBwR29nSnk0QlZXUlFxYUVJZUFEQ0tJSEJmK3hjRmI1SEw5MmlBanI1MkhPWUlXQ2c9PQo=",
|
||||||
|
"url": "https://xymd.wangjinding.com/download/xymd_2.6.7_amd64.AppImage",
|
||||||
|
"size": 108648952,
|
||||||
|
"sha256": "c559b4e64ca668898a15e22972622a19d5be96ac77adce96c4e60d60b6a90d5f"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "xiaoyin-markdown"
|
name = "xiaoyin-markdown"
|
||||||
version = "2.6.1"
|
version = "2.6.7"
|
||||||
description = "小银 Markdown —— 轻量本地 Markdown 编辑器"
|
description = "小银 Markdown —— 轻量本地 Markdown 编辑器"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
@@ -11,8 +11,15 @@ tauri-build = { version = "2", features = [] }
|
|||||||
tauri = { version = "2", features = [] }
|
tauri = { version = "2", features = [] }
|
||||||
tauri-plugin-dialog = "2"
|
tauri-plugin-dialog = "2"
|
||||||
tauri-plugin-single-instance = "2"
|
tauri-plugin-single-instance = "2"
|
||||||
|
# 在线升级:官方 updater(minisign 签名校验)+ process(升级后重启)
|
||||||
|
tauri-plugin-updater = "2"
|
||||||
|
tauri-plugin-process = "2"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
chrono = "0.4"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
# —— 三端:平台专属依赖各归各的 ——
|
||||||
|
# Windows:剪贴板里放「文件本身」要靠 Win32 的 CF_HDROP
|
||||||
|
[target.'cfg(windows)'.dependencies]
|
||||||
clipboard-win = "5"
|
clipboard-win = "5"
|
||||||
windows-sys = { version = "0.61", features = [
|
windows-sys = { version = "0.61", features = [
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
@@ -22,6 +29,10 @@ windows-sys = { version = "0.61", features = [
|
|||||||
"Win32_UI_WindowsAndMessaging"
|
"Win32_UI_WindowsAndMessaging"
|
||||||
] }
|
] }
|
||||||
|
|
||||||
|
# macOS / Linux:文本剪贴板用 arboard(macOS 走 NSPasteboard,Linux 走 X11/Wayland)
|
||||||
|
[target.'cfg(not(windows))'.dependencies]
|
||||||
|
arboard = "3"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
lto = true
|
lto = true
|
||||||
|
|||||||
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
</adaptive-icon>
|
||||||
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="ic_launcher_background">#FFFFFF</color>
|
||||||
|
</resources>
|
||||||
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 1001 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 332 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,34 @@
|
|||||||
|
; ── 小银 Markdown NSIS 安装钩子 ────────────────────────────────────────────
|
||||||
|
; 目标:安装完成后,双击 .md 默认就用小银 Markdown 打开。
|
||||||
|
;
|
||||||
|
; 背景:Tauri 的 fileAssociations 会写 HKCU\Software\Classes 下的关联,但 Windows 10/11
|
||||||
|
; 还有一个带哈希保护的「用户选择」键:
|
||||||
|
; HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.md\UserChoice
|
||||||
|
; 它优先级**最高**,而且不能直接写(哈希由系统算)。但它可以**删** ——
|
||||||
|
; 删掉之后系统就回落到我们刚写的 HKCU\Software\Classes 关联,等于把默认打开方式交给本程序。
|
||||||
|
;
|
||||||
|
; 只动 HKCU(安装模式是 currentUser),不需要管理员权限。
|
||||||
|
|
||||||
|
!macro NSIS_HOOK_POSTINSTALL
|
||||||
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.md\UserChoice"
|
||||||
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.markdown\UserChoice"
|
||||||
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mdown\UserChoice"
|
||||||
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mkd\UserChoice"
|
||||||
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mdwn\UserChoice"
|
||||||
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice"
|
||||||
|
|
||||||
|
; 让资源管理器立刻刷新图标与「打开方式」缓存(SHCNE_ASSOCCHANGED)
|
||||||
|
System::Call 'shell32::SHChangeNotify(l 0x08000000, l 0, l 0, l 0)'
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro NSIS_HOOK_POSTUNINSTALL
|
||||||
|
; 卸载时一并清掉可能残留的关联(不怕清不到)
|
||||||
|
DeleteRegKey HKCU "Software\Classes\.md"
|
||||||
|
DeleteRegKey HKCU "Software\Classes\.markdown"
|
||||||
|
DeleteRegKey HKCU "Software\Classes\.mdown"
|
||||||
|
DeleteRegKey HKCU "Software\Classes\.mkd"
|
||||||
|
DeleteRegKey HKCU "Software\Classes\.mdwn"
|
||||||
|
DeleteRegKey HKCU "Software\Classes\XiaoyinMarkdown.Document"
|
||||||
|
DeleteRegKey HKCU "Software\Classes\XiaoyinMarkdown.Text"
|
||||||
|
System::Call 'shell32::SHChangeNotify(l 0x08000000, l 0, l 0, l 0)'
|
||||||
|
!macroend
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
// 小银 Markdown —— Tauri 2 后端
|
// 小银 Markdown —— Tauri 2 后端
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
// 只在 Windows 上隐藏控制台窗口(macOS/Linux 没有这个概念)
|
||||||
|
#![cfg_attr(all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows")]
|
||||||
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
@@ -9,6 +10,9 @@ use tauri_plugin_dialog::DialogExt;
|
|||||||
|
|
||||||
const MD_EXTS: [&str; 6] = ["md", "markdown", "mdown", "mkd", "mdwn", "txt"];
|
const MD_EXTS: [&str; 6] = ["md", "markdown", "mdown", "mkd", "mdwn", "txt"];
|
||||||
|
|
||||||
|
/// 首次启动时 argv 里的文件只发一次(页面重载/多窗口不重复发)
|
||||||
|
static STARTUP_FILE_SENT: std::sync::Once = std::sync::Once::new();
|
||||||
|
|
||||||
/* ---------------- 数据结构 ---------------- */
|
/* ---------------- 数据结构 ---------------- */
|
||||||
|
|
||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Clone)]
|
||||||
@@ -251,9 +255,10 @@ fn read_dir(path: String) -> DirResult {
|
|||||||
|
|
||||||
/* ---------------- 剪贴板 ---------------- */
|
/* ---------------- 剪贴板 ---------------- */
|
||||||
|
|
||||||
|
/// Windows:把「文件本身」放进剪贴板(CF_HDROP),能直接粘到资源管理器 / 微信
|
||||||
|
#[cfg(windows)]
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn copy_file_to_clipboard(path: String) -> Result<(), String> {
|
fn copy_file_to_clipboard(path: String) -> Result<(), String> {
|
||||||
// 手写 CF_HDROP:DROPFILES 头 + 双 \0 结尾的 UTF-16 路径列表
|
|
||||||
use windows_sys::Win32::System::DataExchange::{CloseClipboard, EmptyClipboard, OpenClipboard, SetClipboardData};
|
use windows_sys::Win32::System::DataExchange::{CloseClipboard, EmptyClipboard, OpenClipboard, SetClipboardData};
|
||||||
use windows_sys::Win32::System::Memory::{GlobalAlloc, GlobalLock, GlobalUnlock, GMEM_MOVEABLE, GMEM_ZEROINIT};
|
use windows_sys::Win32::System::Memory::{GlobalAlloc, GlobalLock, GlobalUnlock, GMEM_MOVEABLE, GMEM_ZEROINIT};
|
||||||
use windows_sys::Win32::UI::Shell::DROPFILES;
|
use windows_sys::Win32::UI::Shell::DROPFILES;
|
||||||
@@ -270,10 +275,10 @@ fn copy_file_to_clipboard(path: String) -> Result<(), String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut wide: Vec<u16> = path.encode_utf16().collect();
|
let mut wide: Vec<u16> = path.encode_utf16().collect();
|
||||||
wide.push(0); // 路径自身的 \0 终止符
|
wide.push(0);
|
||||||
|
|
||||||
let header_size = std::mem::size_of::<DROPFILES>();
|
let header_size = std::mem::size_of::<DROPFILES>();
|
||||||
let list_bytes = (wide.len() + 1) * 2; // +1 是列表级双 \0 结束符
|
let list_bytes = (wide.len() + 1) * 2;
|
||||||
let total = header_size + list_bytes;
|
let total = header_size + list_bytes;
|
||||||
|
|
||||||
let h = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, total);
|
let h = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, total);
|
||||||
@@ -288,7 +293,7 @@ fn copy_file_to_clipboard(path: String) -> Result<(), String> {
|
|||||||
}
|
}
|
||||||
let df = locked as *mut DROPFILES;
|
let df = locked as *mut DROPFILES;
|
||||||
(*df).pFiles = header_size as u32;
|
(*df).pFiles = header_size as u32;
|
||||||
(*df).fWide = 1; // UTF-16
|
(*df).fWide = 1;
|
||||||
let dst = (locked as *mut u8).add(header_size);
|
let dst = (locked as *mut u8).add(header_size);
|
||||||
std::ptr::copy_nonoverlapping(wide.as_ptr() as *const u8, dst, wide.len() * 2);
|
std::ptr::copy_nonoverlapping(wide.as_ptr() as *const u8, dst, wide.len() * 2);
|
||||||
GlobalUnlock(h);
|
GlobalUnlock(h);
|
||||||
@@ -302,18 +307,42 @@ fn copy_file_to_clipboard(path: String) -> Result<(), String> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// macOS / Linux:剪贴板没有跨平台的「文件」格式(要写 GTK/X11 私有 target),
|
||||||
|
/// 退化成把路径当文本复制 —— 粘到终端、编辑器、下载框里都还能用。
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
#[tauri::command]
|
||||||
|
fn copy_file_to_clipboard(path: String) -> Result<(), String> {
|
||||||
|
write_clipboard_text(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn read_clipboard_text() -> String {
|
fn read_clipboard_text() -> String {
|
||||||
use clipboard_win::formats;
|
use clipboard_win::formats;
|
||||||
use clipboard_win::get_clipboard;
|
clipboard_win::get_clipboard(formats::Unicode).unwrap_or_default()
|
||||||
get_clipboard(formats::Unicode).unwrap_or_default()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
#[tauri::command]
|
||||||
|
fn read_clipboard_text() -> String {
|
||||||
|
arboard::Clipboard::new()
|
||||||
|
.and_then(|mut c| c.get_text())
|
||||||
|
.unwrap_or_default()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn write_clipboard_text(text: String) -> Result<(), String> {
|
fn write_clipboard_text(text: String) -> Result<(), String> {
|
||||||
use clipboard_win::formats;
|
use clipboard_win::formats;
|
||||||
use clipboard_win::set_clipboard;
|
clipboard_win::set_clipboard(formats::Unicode, text).map_err(|e| e.to_string())
|
||||||
set_clipboard(formats::Unicode, text).map_err(|e| e.to_string())
|
}
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
#[tauri::command]
|
||||||
|
fn write_clipboard_text(text: String) -> Result<(), String> {
|
||||||
|
arboard::Clipboard::new()
|
||||||
|
.and_then(|mut c| c.set_text(text))
|
||||||
|
.map_err(|e| e.to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------- 系统 ---------------- */
|
/* ---------------- 系统 ---------------- */
|
||||||
@@ -321,6 +350,10 @@ fn write_clipboard_text(text: String) -> Result<(), String> {
|
|||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn reveal_in_explorer(path: String) -> Result<(), String> {
|
fn reveal_in_explorer(path: String) -> Result<(), String> {
|
||||||
let p = PathBuf::from(&path);
|
let p = PathBuf::from(&path);
|
||||||
|
|
||||||
|
// Windows:资源管理器并选中该文件
|
||||||
|
#[cfg(windows)]
|
||||||
|
{
|
||||||
if p.is_file() {
|
if p.is_file() {
|
||||||
std::process::Command::new("explorer")
|
std::process::Command::new("explorer")
|
||||||
.arg(format!("/select,{}", p.to_string_lossy()))
|
.arg(format!("/select,{}", p.to_string_lossy()))
|
||||||
@@ -332,7 +365,42 @@ fn reveal_in_explorer(path: String) -> Result<(), String> {
|
|||||||
.spawn()
|
.spawn()
|
||||||
.map_err(|e| e.to_string())?;
|
.map_err(|e| e.to_string())?;
|
||||||
}
|
}
|
||||||
Ok(())
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
// macOS:Finder 里选中(open -R)
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
{
|
||||||
|
let _ = &p;
|
||||||
|
if p.is_file() {
|
||||||
|
std::process::Command::new("open")
|
||||||
|
.arg("-R")
|
||||||
|
.arg(&p)
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| e.to_string())?;
|
||||||
|
} else {
|
||||||
|
std::process::Command::new("open")
|
||||||
|
.arg(&p)
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| e.to_string())?;
|
||||||
|
}
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Linux:没有统一的「选中」接口,打开所在目录
|
||||||
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
|
{
|
||||||
|
let dir = if p.is_dir() {
|
||||||
|
p.clone()
|
||||||
|
} else {
|
||||||
|
p.parent().map(|x| x.to_path_buf()).unwrap_or(p.clone())
|
||||||
|
};
|
||||||
|
std::process::Command::new("xdg-open")
|
||||||
|
.arg(&dir)
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| e.to_string())?;
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
@@ -340,11 +408,31 @@ fn open_external(url: String) -> Result<(), String> {
|
|||||||
if !url.starts_with("http://") && !url.starts_with("https://") {
|
if !url.starts_with("http://") && !url.starts_with("https://") {
|
||||||
return Err("仅允许打开 http/https 链接".into());
|
return Err("仅允许打开 http/https 链接".into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
{
|
||||||
std::process::Command::new("explorer")
|
std::process::Command::new("explorer")
|
||||||
.arg(&url)
|
.arg(&url)
|
||||||
.spawn()
|
.spawn()
|
||||||
.map_err(|e| e.to_string())?;
|
.map_err(|e| e.to_string())?;
|
||||||
Ok(())
|
return Ok(());
|
||||||
|
}
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
{
|
||||||
|
std::process::Command::new("open")
|
||||||
|
.arg(&url)
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| e.to_string())?;
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
|
{
|
||||||
|
std::process::Command::new("xdg-open")
|
||||||
|
.arg(&url)
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| e.to_string())?;
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
@@ -456,11 +544,111 @@ fn migrate_apply(app: AppHandle, mode: String, docs: Vec<serde_json::Value>, kee
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------- 在线升级 ---------------- */
|
||||||
|
|
||||||
|
/// 检查结果回给前端:available=false 时 version 就是当前版本
|
||||||
|
#[derive(Serialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
struct UpdateStatus {
|
||||||
|
available: bool,
|
||||||
|
current: String,
|
||||||
|
version: String,
|
||||||
|
notes: String,
|
||||||
|
date: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 当前程序版本(状态栏显示用,不联网)
|
||||||
|
#[tauri::command]
|
||||||
|
fn app_version(app: AppHandle) -> String {
|
||||||
|
app.package_info().version.to_string()
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 查 https://xymd.wangjinding.com/update/latest.json 有没有比当前新的版本。
|
||||||
|
/// 旧域名 md.wangjinding.com 已于 2026-11-20 停用(EdgeOne / 1Panel / DNS 全部删除)。
|
||||||
|
/// 用官方 updater 插件:带 minisign 签名校验,装的是签名过的安装包,避免被中间人替换。
|
||||||
|
#[tauri::command]
|
||||||
|
async fn check_update(app: AppHandle) -> Result<UpdateStatus, String> {
|
||||||
|
use tauri_plugin_updater::UpdaterExt;
|
||||||
|
let current = app.package_info().version.to_string();
|
||||||
|
let updater = app.updater().map_err(|e| format!("初始化升级器失败:{e}"))?;
|
||||||
|
match updater.check().await {
|
||||||
|
Ok(Some(u)) => Ok(UpdateStatus {
|
||||||
|
available: true,
|
||||||
|
current,
|
||||||
|
version: u.version.clone(),
|
||||||
|
notes: u.body.clone().unwrap_or_default(),
|
||||||
|
// u.date 是 time::OffsetDateTime(UTC)。默认 Display 是 "2:43:08.0 +00:00:00",
|
||||||
|
// 这里按时间戳转成本地时间,精确到分钟。
|
||||||
|
date: u
|
||||||
|
.date
|
||||||
|
.and_then(|d| {
|
||||||
|
chrono::DateTime::from_timestamp(d.unix_timestamp(), 0)
|
||||||
|
.map(|c| c.with_timezone(&chrono::Local).format("%Y-%m-%d %H:%M").to_string())
|
||||||
|
})
|
||||||
|
.unwrap_or_default(),
|
||||||
|
}),
|
||||||
|
Ok(None) => Ok(UpdateStatus {
|
||||||
|
available: false,
|
||||||
|
version: current.clone(),
|
||||||
|
current,
|
||||||
|
notes: String::new(),
|
||||||
|
date: String::new(),
|
||||||
|
}),
|
||||||
|
Err(e) => Err(format!("检查更新失败:{e}")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 下载 + 校验签名 + 跑安装包覆盖安装,然后重启自己。
|
||||||
|
/// 进度通过 `update-progress` 事件推给前端(chunk 为已下载字节,total 可能为 null)。
|
||||||
|
#[tauri::command]
|
||||||
|
async fn install_update(app: AppHandle) -> Result<(), String> {
|
||||||
|
use tauri_plugin_updater::UpdaterExt;
|
||||||
|
let updater = app.updater().map_err(|e| format!("初始化升级器失败:{e}"))?;
|
||||||
|
let found = updater.check().await.map_err(|e| format!("检查更新失败:{e}"))?;
|
||||||
|
let Some(update) = found else {
|
||||||
|
return Err("已经是最新版本".into());
|
||||||
|
};
|
||||||
|
let handle = app.clone();
|
||||||
|
let mut downloaded: u64 = 0;
|
||||||
|
update
|
||||||
|
.download_and_install(
|
||||||
|
move |chunk: usize, total: Option<u64>| {
|
||||||
|
downloaded += chunk as u64;
|
||||||
|
let _ = handle.emit(
|
||||||
|
"update-progress",
|
||||||
|
serde_json::json!({ "downloaded": downloaded, "total": total }),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|| {},
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.map_err(|e| format!("下载或安装失败:{e}"))?;
|
||||||
|
// 安装包已静默跑完并覆盖了程序,重启到新版本
|
||||||
|
let _ = app.emit("update-restarting", serde_json::json!({}));
|
||||||
|
app.restart();
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------------- 入口 ---------------- */
|
/* ---------------- 入口 ---------------- */
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.plugin(tauri_plugin_dialog::init())
|
.plugin(tauri_plugin_dialog::init())
|
||||||
|
// 双击 .md 用本程序打开时的「首次启动」路径:
|
||||||
|
// · 首次启动(进程还不存在)→ 页面加载完成后把 argv 里的文件发给前端
|
||||||
|
// · 已在运行(再双击另一个文件)→ 走下面的 single_instance 回调
|
||||||
|
// 用 Once 保证只发一次,避免页面重载时反复打开同一个文件。
|
||||||
|
.on_page_load(|webview, payload| {
|
||||||
|
if payload.event() == tauri::webview::PageLoadEvent::Finished {
|
||||||
|
STARTUP_FILE_SENT.call_once(|| {
|
||||||
|
if let Some(path) = std::env::args()
|
||||||
|
.skip(1)
|
||||||
|
.find(|a| PathBuf::from(a).is_file())
|
||||||
|
{
|
||||||
|
let _ = webview.emit("open-external", path);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
.plugin(tauri_plugin_single_instance::init(|app, argv, _cwd| {
|
.plugin(tauri_plugin_single_instance::init(|app, argv, _cwd| {
|
||||||
if let Some(win) = app.get_webview_window("main") {
|
if let Some(win) = app.get_webview_window("main") {
|
||||||
let _ = win.set_focus();
|
let _ = win.set_focus();
|
||||||
@@ -472,6 +660,8 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||||
|
.plugin(tauri_plugin_process::init())
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![
|
||||||
read_text_file,
|
read_text_file,
|
||||||
write_text_file,
|
write_text_file,
|
||||||
@@ -488,7 +678,10 @@ fn main() {
|
|||||||
open_new_window,
|
open_new_window,
|
||||||
force_close,
|
force_close,
|
||||||
get_window_count,
|
get_window_count,
|
||||||
migrate_apply
|
migrate_apply,
|
||||||
|
app_version,
|
||||||
|
check_update,
|
||||||
|
install_update
|
||||||
])
|
])
|
||||||
.on_window_event(|window, event| {
|
.on_window_event(|window, event| {
|
||||||
if let WindowEvent::CloseRequested { api, .. } = event {
|
if let WindowEvent::CloseRequested { api, .. } = event {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "XiaoyinMarkdown",
|
"productName": "XiaoyinMarkdown",
|
||||||
"version": "2.6.1",
|
"version": "2.6.7",
|
||||||
"identifier": "com.xiaoyin.markdown",
|
"identifier": "com.xiaoyin.markdown",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../src/renderer"
|
"frontendDist": "../src/renderer"
|
||||||
@@ -25,17 +25,31 @@
|
|||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"targets": ["nsis"],
|
"targets": "all",
|
||||||
"icon": ["icons/icon.ico"],
|
"icon": [
|
||||||
|
"icons/32x32.png",
|
||||||
|
"icons/128x128.png",
|
||||||
|
"icons/128x128@2x.png",
|
||||||
|
"icons/icon.icns",
|
||||||
|
"icons/icon.ico"
|
||||||
|
],
|
||||||
"fileAssociations": [
|
"fileAssociations": [
|
||||||
{
|
{
|
||||||
"ext": ["md", "markdown", "mdown", "mkd", "mdwn"],
|
"ext": [
|
||||||
|
"md",
|
||||||
|
"markdown",
|
||||||
|
"mdown",
|
||||||
|
"mkd",
|
||||||
|
"mdwn"
|
||||||
|
],
|
||||||
"name": "XiaoyinMarkdown.Document",
|
"name": "XiaoyinMarkdown.Document",
|
||||||
"description": "Markdown 文档 — 小银 Markdown",
|
"description": "Markdown 文档 — 小银 Markdown",
|
||||||
"role": "Editor"
|
"role": "Editor"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ext": ["txt"],
|
"ext": [
|
||||||
|
"txt"
|
||||||
|
],
|
||||||
"name": "XiaoyinMarkdown.Text",
|
"name": "XiaoyinMarkdown.Text",
|
||||||
"description": "文本文档 — 小银 Markdown",
|
"description": "文本文档 — 小银 Markdown",
|
||||||
"role": "Editor"
|
"role": "Editor"
|
||||||
@@ -47,10 +61,39 @@
|
|||||||
},
|
},
|
||||||
"nsis": {
|
"nsis": {
|
||||||
"installMode": "currentUser",
|
"installMode": "currentUser",
|
||||||
"languages": ["SimpChinese"],
|
"languages": [
|
||||||
|
"SimpChinese"
|
||||||
|
],
|
||||||
"displayLanguageSelector": false,
|
"displayLanguageSelector": false,
|
||||||
"installerIcon": "icons/icon.ico",
|
"installerIcon": "icons/icon.ico",
|
||||||
"uninstallerIcon": "icons/icon.ico"
|
"uninstallerIcon": "icons/icon.ico",
|
||||||
|
"installerHooks": "installer-hooks.nsh"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"createUpdaterArtifacts": true,
|
||||||
|
"linux": {
|
||||||
|
"deb": {
|
||||||
|
"depends": [
|
||||||
|
"libwebkit2gtk-4.1-0",
|
||||||
|
"libgtk-3-0"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"appimage": {
|
||||||
|
"bundleMediaFramework": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"macOS": {
|
||||||
|
"minimumSystemVersion": "10.15"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins": {
|
||||||
|
"updater": {
|
||||||
|
"endpoints": [
|
||||||
|
"https://xymd.wangjinding.com/update/latest.json"
|
||||||
|
],
|
||||||
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEVFMjMxQjcwNzlFMDhCNTgKUldSWWkrQjVjQnNqN3Ewazg0U1VTN2VHSmE5amRROEIzN2UrK2w4dlJ5R05rcGhTY0FuNUk3NUwK",
|
||||||
|
"windows": {
|
||||||
|
"installMode": "passive"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
<span id="openmode-label">标签</span>
|
<span id="openmode-label">标签</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
<button class="tb-icon" id="btn-theme" title="切换深色/浅色 (Ctrl+Shift+L)">
|
<button class="tb-icon" id="btn-theme" title="切换深色/浅色 (Ctrl+Shift+L)">
|
||||||
<svg viewBox="0 0 16 16"><path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 1.5v11a5.5 5.5 0 010-11z"/></svg>
|
<svg viewBox="0 0 16 16"><path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 1.5v11a5.5 5.5 0 010-11z"/></svg>
|
||||||
</button>
|
</button>
|
||||||
@@ -160,6 +161,10 @@
|
|||||||
<span id="st-cursor">第 1 行, 第 1 列</span>
|
<span id="st-cursor">第 1 行, 第 1 列</span>
|
||||||
<span class="st-div">|</span>
|
<span class="st-div">|</span>
|
||||||
<span>UTF-8</span>
|
<span>UTF-8</span>
|
||||||
|
<span class="st-div">|</span>
|
||||||
|
<span id="st-ver" title="当前版本">v2.6.5</span>
|
||||||
|
<span class="st-div">|</span>
|
||||||
|
<a class="st-link" id="btn-update" title="检查更新">检查更新</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@@ -699,6 +699,10 @@ html[data-theme="dark"] .markdown-body code { color: #f0a1c0; }
|
|||||||
color: var(--text-faint);
|
color: var(--text-faint);
|
||||||
}
|
}
|
||||||
.st-left, .st-right { display: flex; align-items: center; gap: 8px; }
|
.st-left, .st-right { display: flex; align-items: center; gap: 8px; }
|
||||||
|
/* 状态栏里的「检查更新」文字链接 */
|
||||||
|
.st-link { color: var(--accent); cursor: pointer; text-decoration: none; }
|
||||||
|
.st-link:hover { text-decoration: underline; }
|
||||||
|
.st-link.busy { opacity: .5; pointer-events: none; }
|
||||||
.st-file { color: var(--text-dim); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
.st-file { color: var(--text-dim); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
.st-dirty {
|
.st-dirty {
|
||||||
padding: 1px 6px;
|
padding: 1px 6px;
|
||||||
|
|||||||
@@ -33,12 +33,13 @@
|
|||||||
box.appendChild(msg);
|
box.appendChild(msg);
|
||||||
if (o.detail) {
|
if (o.detail) {
|
||||||
const d = document.createElement('div');
|
const d = document.createElement('div');
|
||||||
d.style.cssText = 'opacity:.7;margin-bottom:14px;line-height:1.5;';
|
// pre-wrap:更新说明是多行编号,不保留换行会被压成一坨
|
||||||
|
d.style.cssText = 'opacity:.72;margin-bottom:14px;line-height:1.7;white-space:pre-wrap;';
|
||||||
d.textContent = o.detail;
|
d.textContent = o.detail;
|
||||||
box.appendChild(d);
|
box.appendChild(d);
|
||||||
}
|
}
|
||||||
const row = document.createElement('div');
|
const row = document.createElement('div');
|
||||||
row.style.cssText = 'display:flex;gap:8px;justify-content:flex-end;';
|
row.style.cssText = 'display:flex;gap:10px;justify-content:center;margin-top:4px;';
|
||||||
buttons.forEach((label, i) => {
|
buttons.forEach((label, i) => {
|
||||||
const b = document.createElement('button');
|
const b = document.createElement('button');
|
||||||
b.textContent = label;
|
b.textContent = label;
|
||||||
@@ -158,6 +159,99 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------- 在线升级(服务端:https://xymd.wangjinding.com/update/latest.json) ---------- */
|
||||||
|
const updateBtn = document.getElementById('btn-update');
|
||||||
|
if (updateBtn) updateBtn.addEventListener('click', runUpdate);
|
||||||
|
let updating = false;
|
||||||
|
|
||||||
|
// 状态栏显示当前版本(静态值只是兜底,这里用真实版本覆盖)
|
||||||
|
const verEl = document.getElementById('st-ver');
|
||||||
|
if (verEl) {
|
||||||
|
invoke('app_version')
|
||||||
|
.then((v) => { if (v) verEl.textContent = 'v' + v; })
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 升级进度浮层 */
|
||||||
|
function progressUI(title) {
|
||||||
|
const mask = document.createElement('div');
|
||||||
|
mask.style.cssText = 'position:fixed;inset:0;background:rgba(0,0,0,.32);z-index:99998;'
|
||||||
|
+ 'display:flex;align-items:center;justify-content:center;font-family:system-ui,sans-serif;';
|
||||||
|
const box = document.createElement('div');
|
||||||
|
box.style.cssText = 'background:#fff;color:#222;border-radius:12px;padding:24px 26px;'
|
||||||
|
+ 'width:380px;box-shadow:0 20px 60px rgba(0,0,0,.3);';
|
||||||
|
const t = document.createElement('div');
|
||||||
|
t.style.cssText = 'font-size:14px;font-weight:600;margin-bottom:14px;';
|
||||||
|
t.textContent = title;
|
||||||
|
const track = document.createElement('div');
|
||||||
|
track.style.cssText = 'height:6px;border-radius:4px;background:#eceef3;overflow:hidden;';
|
||||||
|
const bar = document.createElement('div');
|
||||||
|
bar.style.cssText = 'height:100%;width:6%;background:linear-gradient(90deg,#3a7bfc,#0b66dd);'
|
||||||
|
+ 'transition:width .25s ease;';
|
||||||
|
track.appendChild(bar);
|
||||||
|
const sub = document.createElement('div');
|
||||||
|
sub.style.cssText = 'margin-top:10px;font-size:12.5px;color:#7a8494;';
|
||||||
|
sub.textContent = '正在下载…';
|
||||||
|
box.append(t, track, sub);
|
||||||
|
mask.appendChild(box);
|
||||||
|
document.body.appendChild(mask);
|
||||||
|
return {
|
||||||
|
set(p) {
|
||||||
|
if (!p) return;
|
||||||
|
if (p.done) { bar.style.width = '100%'; sub.textContent = '安装完成,正在重启…'; return; }
|
||||||
|
const d = p.downloaded || 0;
|
||||||
|
const total = p.total || 0;
|
||||||
|
if (total > 0) {
|
||||||
|
bar.style.width = Math.min(100, (d / total) * 100).toFixed(1) + '%';
|
||||||
|
sub.textContent = `${(d / 1048576).toFixed(1)} / ${(total / 1048576).toFixed(1)} MB`;
|
||||||
|
} else {
|
||||||
|
sub.textContent = `${(d / 1048576).toFixed(1)} MB`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() { mask.remove(); },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function runUpdate() {
|
||||||
|
if (!updateBtn || updating) return;
|
||||||
|
updating = true;
|
||||||
|
updateBtn.classList.add('busy');
|
||||||
|
try {
|
||||||
|
const st = await invoke('check_update');
|
||||||
|
if (!st || !st.available) {
|
||||||
|
await modalDialog({ message: '已是最新版本', buttons: ['好'] });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const lines = [];
|
||||||
|
if (st.date) lines.push(`发布时间:${st.date}`);
|
||||||
|
if (st.notes) lines.push('', st.notes);
|
||||||
|
const pick = await modalDialog({
|
||||||
|
message: `发现新版本 v${st.version}`,
|
||||||
|
detail: lines.join('\n'),
|
||||||
|
buttons: ['立即升级', '稍后'],
|
||||||
|
});
|
||||||
|
if (pick !== 0) return;
|
||||||
|
|
||||||
|
const ui = progressUI(`正在升级到 v${st.version}…`);
|
||||||
|
let un = null;
|
||||||
|
try {
|
||||||
|
un = await listen('update-progress', (e) => ui.set(e.payload));
|
||||||
|
await invoke('install_update');
|
||||||
|
ui.set({ done: true });
|
||||||
|
} catch (e) {
|
||||||
|
if (un) un();
|
||||||
|
ui.close();
|
||||||
|
await modalDialog({ message: '升级失败', detail: String((e && e.message) || e), buttons: ['好'] });
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
await modalDialog({ message: '检查更新失败', detail: String((e && e.message) || e), buttons: ['好'] });
|
||||||
|
} finally {
|
||||||
|
updating = false;
|
||||||
|
updateBtn.classList.remove('busy');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------- 拖放(Tauri 系统级,拿得到真实路径) ---------- */
|
/* ---------- 拖放(Tauri 系统级,拿得到真实路径) ---------- */
|
||||||
cur.onDragDropEvent((e) => {
|
cur.onDragDropEvent((e) => {
|
||||||
const p = e.payload;
|
const p = e.payload;
|
||||||
|
|||||||
@@ -0,0 +1,218 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""把三端构建产物发布到官网,并生成/合并升级清单。
|
||||||
|
|
||||||
|
用法:
|
||||||
|
python3 tools/release/publish.py --notes-file notes.txt # 自动扫描全部产物
|
||||||
|
python3 tools/release/publish.py --notes "一句话" --dry-run
|
||||||
|
|
||||||
|
自动识别(存在哪些就发哪些,都按平台归位):
|
||||||
|
Windows target/x86_64-pc-windows-gnu/release/bundle/nsis/*x64-setup.exe
|
||||||
|
Linux target/release/bundle/{appimage/*.AppImage, deb/*.deb}
|
||||||
|
macOS target/<triple>/release/bundle/{macos/*.app.tar.gz, dmg/*.dmg}
|
||||||
|
|
||||||
|
升级清单是**合并**的:只更新这次扫到的平台,其它平台的条目原样保留
|
||||||
|
(这样在 Windows 上发版不会把 macOS 的那条冲掉)。
|
||||||
|
|
||||||
|
客户端拉取:https://xymd.wangjinding.com/update/latest.json
|
||||||
|
"""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
import platform as _py_platform
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
import sys
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
SITE = ROOT / "site"
|
||||||
|
SITE_ROOT = Path("/opt/1panel/www/sites/<域名>/index")
|
||||||
|
SITE_DOWNLOAD = SITE_ROOT / "download"
|
||||||
|
SITE_UPDATE = SITE_ROOT / "update"
|
||||||
|
BASE_URL = "https://xymd.wangjinding.com"
|
||||||
|
TARGETS = ROOT / "src-tauri" / "target"
|
||||||
|
|
||||||
|
|
||||||
|
def conf_version() -> str:
|
||||||
|
d = json.loads((ROOT / "src-tauri" / "tauri.conf.json").read_text(encoding="utf-8"))
|
||||||
|
return d["version"]
|
||||||
|
|
||||||
|
|
||||||
|
def sha256(path: Path) -> str:
|
||||||
|
h = hashlib.sha256()
|
||||||
|
with path.open("rb") as f:
|
||||||
|
for chunk in iter(lambda: f.read(1 << 20), b""):
|
||||||
|
h.update(chunk)
|
||||||
|
return h.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def find_one(patterns: list[str]) -> Path | None:
|
||||||
|
for pat in patterns:
|
||||||
|
hits = sorted(TARGETS.glob(pat), key=lambda p: p.stat().st_mtime, reverse=True)
|
||||||
|
if hits:
|
||||||
|
return hits[0]
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def artifact_version(path: Path) -> str | None:
|
||||||
|
"""从文件名里抠出构建版本,如 XiaoyinMarkdown_2.6.6_x64-setup.exe → 2.6.6"""
|
||||||
|
m = re.search(r"_(\d+\.\d+\.\d+)", path.name)
|
||||||
|
return m.group(1) if m else None
|
||||||
|
|
||||||
|
|
||||||
|
def collect():
|
||||||
|
"""返回 [{platform, artifact, sig, dl_name}],只包含本机实际构建出来的。
|
||||||
|
|
||||||
|
只收**版本号对得上**的产物 —— 否则上一版留在 target/ 里的旧包会被
|
||||||
|
改名成新版本发出去(清单写新版本、二进制还是旧版,升级会静默失败)。
|
||||||
|
"""
|
||||||
|
found = []
|
||||||
|
want = conf_version()
|
||||||
|
|
||||||
|
# ── Windows ──
|
||||||
|
exe = find_one([
|
||||||
|
"x86_64-pc-windows-gnu/release/bundle/nsis/*_x64-setup.exe",
|
||||||
|
"release/bundle/nsis/*_x64-setup.exe",
|
||||||
|
])
|
||||||
|
if exe:
|
||||||
|
found.append({"platform": "windows-x86_64", "artifact": exe, "sig": Path(str(exe) + ".sig"), "ext": ".exe"})
|
||||||
|
|
||||||
|
# ── Linux(updater 只认 AppImage,deb 额外给人手装)──
|
||||||
|
appimg = find_one(["release/bundle/appimage/*.AppImage", "*/release/bundle/appimage/*.AppImage"])
|
||||||
|
if appimg:
|
||||||
|
found.append({"platform": "linux-x86_64", "artifact": appimg, "sig": Path(str(appimg) + ".sig"), "ext": ".AppImage"})
|
||||||
|
deb = find_one(["release/bundle/deb/*.deb", "*/release/bundle/deb/*.deb"])
|
||||||
|
if deb:
|
||||||
|
found.append({"platform": "linux-deb", "artifact": deb, "sig": None, "ext": ".deb"})
|
||||||
|
|
||||||
|
# ── macOS(Intel / Apple Silicon 各一份)──
|
||||||
|
for triple, key in (("aarch64-apple-darwin", "darwin-aarch64"), ("x86_64-apple-darwin", "darwin-x86_64")):
|
||||||
|
tar = find_one([f"{triple}/release/bundle/macos/*.app.tar.gz",
|
||||||
|
f"*/{triple}/release/bundle/macos/*.app.tar.gz"])
|
||||||
|
if tar:
|
||||||
|
found.append({"platform": key, "artifact": tar, "sig": Path(str(tar) + ".sig"), "ext": ".app.tar.gz"})
|
||||||
|
dmg = find_one([f"{triple}/release/bundle/dmg/*.dmg", f"*/{triple}/release/bundle/dmg/*.dmg"])
|
||||||
|
if dmg:
|
||||||
|
arch = "aarch64" if "aarch64" in triple else "x64"
|
||||||
|
found.append({"platform": f"{key}-dmg", "artifact": dmg, "sig": None, "ext": f"_{arch}.dmg"})
|
||||||
|
|
||||||
|
# 过滤掉版本对不上的旧产物
|
||||||
|
kept = []
|
||||||
|
for it in found:
|
||||||
|
v = artifact_version(it["artifact"])
|
||||||
|
if v and v != want:
|
||||||
|
print(f" ⏭ 跳过 {it['artifact'].name}(版本 {v} ≠ 当前 {want})")
|
||||||
|
continue
|
||||||
|
kept.append(it)
|
||||||
|
return kept
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> int:
|
||||||
|
ap = argparse.ArgumentParser()
|
||||||
|
ap.add_argument("--notes", default="")
|
||||||
|
ap.add_argument("--notes-file", default="")
|
||||||
|
ap.add_argument("--dry-run", action="store_true")
|
||||||
|
args = ap.parse_args()
|
||||||
|
if args.notes_file:
|
||||||
|
args.notes = Path(args.notes_file).read_text(encoding="utf-8").strip()
|
||||||
|
|
||||||
|
version = conf_version()
|
||||||
|
items = collect()
|
||||||
|
if not items:
|
||||||
|
print("❌ 没找到任何构建产物(先跑 `npx tauri build`)", file=sys.stderr)
|
||||||
|
return 1
|
||||||
|
|
||||||
|
# 现有清单(合并用)
|
||||||
|
manifest_path = SITE_UPDATE / "latest.json"
|
||||||
|
manifest = {"version": version, "notes": args.notes or f"小银 Markdown v{version}",
|
||||||
|
"pub_date": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
||||||
|
"platforms": {}}
|
||||||
|
if manifest_path.exists():
|
||||||
|
try:
|
||||||
|
old = json.loads(manifest_path.read_text(encoding="utf-8"))
|
||||||
|
manifest["platforms"] = old.get("platforms", {})
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
print(f" 版本: {version}\n")
|
||||||
|
for it in items:
|
||||||
|
art: Path = it["artifact"]
|
||||||
|
size = art.stat().st_size
|
||||||
|
digest = sha256(art)
|
||||||
|
|
||||||
|
# 落地文件名:xymd_<版本>[_arch].<ext>
|
||||||
|
if it["platform"] == "windows-x86_64":
|
||||||
|
dl = f"xymd_{version}{it['ext']}"
|
||||||
|
elif it["platform"] == "linux-x86_64":
|
||||||
|
dl = f"xymd_{version}_amd64{it['ext']}"
|
||||||
|
elif it["platform"] == "linux-deb":
|
||||||
|
dl = f"xymd_{version}_amd64{it['ext']}"
|
||||||
|
else:
|
||||||
|
dl = f"xymd_{version}{it['ext']}"
|
||||||
|
|
||||||
|
url = f"{BASE_URL}/download/{dl}"
|
||||||
|
has_updater = it["sig"] is not None and it["sig"].exists()
|
||||||
|
|
||||||
|
if has_updater:
|
||||||
|
entry = {
|
||||||
|
"signature": it["sig"].read_text(encoding="utf-8").strip(),
|
||||||
|
"url": url,
|
||||||
|
"size": size,
|
||||||
|
"sha256": digest,
|
||||||
|
}
|
||||||
|
key = it["platform"]
|
||||||
|
manifest["platforms"][key] = entry
|
||||||
|
print(f" ✔ {key:18} {art.name} {size/1048576:.2f} MB → /download/{dl}")
|
||||||
|
else:
|
||||||
|
print(f" · {it['platform']:18} {art.name} {size/1048576:.2f} MB → /download/{dl}(不上升级清单)")
|
||||||
|
|
||||||
|
if not args.dry_run:
|
||||||
|
SITE_DOWNLOAD.mkdir(parents=True, exist_ok=True)
|
||||||
|
shutil.copy2(art, SITE_DOWNLOAD / dl)
|
||||||
|
(SITE_DOWNLOAD / dl).chmod(0o644)
|
||||||
|
|
||||||
|
if args.dry_run:
|
||||||
|
print("\n [dry-run] 不写入任何文件")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
# 写清单:站点 + 仓库各一份
|
||||||
|
body = json.dumps(manifest, ensure_ascii=False, indent=2) + "\n"
|
||||||
|
SITE_UPDATE.mkdir(parents=True, exist_ok=True)
|
||||||
|
(SITE_UPDATE / "latest.json").write_text(body, encoding="utf-8")
|
||||||
|
(SITE / "update").mkdir(parents=True, exist_ok=True)
|
||||||
|
(SITE / "update" / "latest.json").write_text(body, encoding="utf-8")
|
||||||
|
|
||||||
|
# 稳定别名(官网页 JS 会按版本改名,这些是 JS 被禁时的兜底)
|
||||||
|
alias_src = None
|
||||||
|
for it in items:
|
||||||
|
if it["platform"] == "windows-x86_64":
|
||||||
|
alias_src = f"xymd_{version}.exe"
|
||||||
|
if alias_src and (SITE_DOWNLOAD / alias_src).exists():
|
||||||
|
for alias in ("latest-setup.exe",):
|
||||||
|
link = SITE_DOWNLOAD / alias
|
||||||
|
if link.is_symlink() or link.exists():
|
||||||
|
link.unlink()
|
||||||
|
link.symlink_to(alias_src)
|
||||||
|
|
||||||
|
# 官网静态兜底版本号
|
||||||
|
idx = SITE / "index.html"
|
||||||
|
if idx.exists():
|
||||||
|
html = idx.read_text(encoding="utf-8")
|
||||||
|
html2 = re.sub(r"(data-ver>)\d+\.\d+\.\d+", lambda m: m.group(1) + version, html)
|
||||||
|
if html2 != html:
|
||||||
|
idx.write_text(html2, encoding="utf-8")
|
||||||
|
if SITE_ROOT.exists():
|
||||||
|
shutil.copy2(idx, SITE_ROOT / "index.html")
|
||||||
|
|
||||||
|
print(f"\n ✅ 清单已更新:{BASE_URL}/update/latest.json({len(manifest['platforms'])} 个平台)")
|
||||||
|
for k in manifest["platforms"]:
|
||||||
|
print(f" · {k}")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
raise SystemExit(main())
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# 官网截图生成
|
||||||
|
|
||||||
|
官网 `site/index.html` 里那几张「真实界面」图是这么来的:
|
||||||
|
|
||||||
|
用**仓库里真实的渲染层**(`src/renderer/{index.html,style.css,app.js,markdown.js}`)跑起来截图,
|
||||||
|
只把 Windows 侧的文件/剪贴板接口换成 `mock-api.js` 里的假数据 ——
|
||||||
|
界面、排版、渲染引擎全是线上那份代码,不是画的效果图。
|
||||||
|
|
||||||
|
## 步骤
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. 复制渲染层 + 挂上 mock
|
||||||
|
rm -rf /tmp/shots/app && mkdir -p /tmp/shots/app
|
||||||
|
cp src/renderer/* /tmp/shots/app/
|
||||||
|
# 在 index.html 里把 <script src="mock-api.js"> 插到 app.js 之前
|
||||||
|
cp tools/screenshots/mock-api.js /tmp/shots/app/
|
||||||
|
|
||||||
|
# 2. 起静态服务
|
||||||
|
cd /tmp/shots/app && python3 -m http.server 8901 &
|
||||||
|
|
||||||
|
# 3. 起无头 Chrome(开 CDP)
|
||||||
|
CH=$(ls ~/.cache/ms-playwright/chromium-*/chrome-linux64/chrome | head -1)
|
||||||
|
$CH --headless=new --no-sandbox --hide-scrollbars --disable-gpu \
|
||||||
|
--force-device-scale-factor=2 --remote-debugging-port=9222 \
|
||||||
|
--window-size=1440,900 about:blank &
|
||||||
|
|
||||||
|
# 4. 截 4 张(浅色分栏 / 深色 / 查找高亮 / 阅读模式)
|
||||||
|
node tools/screenshots/take.mjs
|
||||||
|
|
||||||
|
# 5. 压成网页尺寸(1600 宽,JPEG q88)
|
||||||
|
python3 - <<'PY'
|
||||||
|
from PIL import Image; import os
|
||||||
|
for s, d in {'shot-split':'app-light','shot-dark':'app-dark',
|
||||||
|
'shot-find':'app-find','shot-read':'app-read'}.items():
|
||||||
|
im = Image.open(f'/tmp/shots/out/{s}.png').convert('RGB')
|
||||||
|
w, h = im.size; tw = 1600
|
||||||
|
im.resize((tw, round(h*tw/w)), Image.LANCZOS).save(
|
||||||
|
f'site/img/{d}.jpg', 'JPEG', quality=88, optimize=True, progressive=True)
|
||||||
|
PY
|
||||||
|
```
|
||||||
|
|
||||||
|
> 截图里打开的是一篇样例「周报」文档,内容在 `mock-api.js` 的 `DOC` 常量里,改文案就改那里。
|
||||||
|
> 注意 `take.mjs` 里打开文件后要等 ~2.8 秒再截 —— 否则底部的「已打开」toast 会留在图上。
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
/* 截图专用 mock:把 Windows 侧的文件/剪贴板接口换成假数据,
|
||||||
|
界面部分(index.html / style.css / app.js / markdown.js)全是仓库里的真实代码。 */
|
||||||
|
(function () {
|
||||||
|
const q = new URLSearchParams(location.search);
|
||||||
|
const theme = q.get('theme') || 'light';
|
||||||
|
const mode = q.get('mode') || 'split';
|
||||||
|
|
||||||
|
// app.js 自己用的状态键,预先写好,避免出现欢迎页
|
||||||
|
localStorage.setItem('md-editor-theme', theme);
|
||||||
|
localStorage.setItem('md-editor-mode', mode);
|
||||||
|
localStorage.setItem('md-editor-outline', '1');
|
||||||
|
localStorage.setItem('md-editor-sb', '0'); // 侧栏展开
|
||||||
|
localStorage.setItem('md-editor-dir', 'D:\\notes');
|
||||||
|
localStorage.setItem('md-editor-welcome-closed', '1');
|
||||||
|
|
||||||
|
const DOC = `# 周报 · 2026 第 47 周
|
||||||
|
|
||||||
|
本周主要在收尾 **小银 Markdown** 的在线升级,顺手把官网也改了一版。
|
||||||
|
|
||||||
|
## 这周做了什么
|
||||||
|
|
||||||
|
- 新增在线升级:状态栏右下角点「检查更新」就能装新版
|
||||||
|
- 安装包换成 Tauri,不再捆绑运行时
|
||||||
|
- 官网换成真实界面截图,配色参照 UU 远程
|
||||||
|
- 修掉 \`Ctrl+F\` 在长文档里的滚动抖动
|
||||||
|
|
||||||
|
## 待办
|
||||||
|
|
||||||
|
- [x] 交叉编译出 Windows 安装包
|
||||||
|
- [x] 装完 .md 默认用它打开
|
||||||
|
- [x] 在线升级跑通签名校验
|
||||||
|
- [ ] 补一段更新日志
|
||||||
|
- [ ] 录个 30 秒的演示视频
|
||||||
|
|
||||||
|
## 关键代码
|
||||||
|
|
||||||
|
\`\`\`js
|
||||||
|
// 检查 → 下载 → 覆盖安装 → 重启
|
||||||
|
const st = await invoke('check_update')
|
||||||
|
if (st.available) await invoke('install_update')
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
## 常用快捷键
|
||||||
|
|
||||||
|
| 操作 | 快捷键 |
|
||||||
|
| --- | --- |
|
||||||
|
| 查找 | Ctrl + F |
|
||||||
|
| 保存 | Ctrl + S |
|
||||||
|
| 深色 / 浅色 | Ctrl + Shift + L |
|
||||||
|
|
||||||
|
> 下周把 README 补一节「用 Tauri 打包」,再录个演示视频。
|
||||||
|
`;
|
||||||
|
|
||||||
|
const TREE = [
|
||||||
|
{ name: '项目', path: 'D:\\notes\\项目', isDir: true },
|
||||||
|
{ name: '日记', path: 'D:\\notes\\日记', isDir: true },
|
||||||
|
{ name: '周报-2026-11-19.md', path: 'D:\\notes\\周报-2026-11-19.md', isDir: false },
|
||||||
|
{ name: '读书笔记.md', path: 'D:\\notes\\读书笔记.md', isDir: false },
|
||||||
|
{ name: '待办.txt', path: 'D:\\notes\\待办.txt', isDir: false },
|
||||||
|
];
|
||||||
|
|
||||||
|
const DOC_PATH = 'D:\\notes\\周报-2026-11-19.md';
|
||||||
|
const ok = (o) => Object.assign({ ok: true }, o || {});
|
||||||
|
const opened = () => ok({ path: DOC_PATH, name: '周报-2026-11-19.md', text: DOC, eol: '\n' });
|
||||||
|
|
||||||
|
window.api = {
|
||||||
|
// ——— 文件 ———
|
||||||
|
open: async () => opened(),
|
||||||
|
openPath: async () => opened(),
|
||||||
|
readFileText: async () => ok({ text: DOC, eol: '\n' }),
|
||||||
|
save: async () => ok({ path: DOC_PATH, name: '周报-2026-11-19.md' }),
|
||||||
|
dirOpen: async () => ok({ path: 'D:\\notes', name: 'notes', entries: TREE }),
|
||||||
|
dirRead: async (p) => ok({ path: p || 'D:\\notes', name: (p || '').split('\\').pop() || 'notes', entries: TREE }),
|
||||||
|
|
||||||
|
// ——— 窗口/标签 ———
|
||||||
|
getOpenMode: async () => ({ mode: 'tabs' }),
|
||||||
|
setOpenMode: async () => ok(),
|
||||||
|
newWindow: async () => ok(),
|
||||||
|
openNewWindow: async () => ok(),
|
||||||
|
closeWindow: async () => ok(),
|
||||||
|
syncDoc: async () => ok(),
|
||||||
|
setDirty: () => {},
|
||||||
|
|
||||||
|
// ——— 提示/对话框 ———
|
||||||
|
message: async () => 0,
|
||||||
|
reveal: async () => ok(),
|
||||||
|
revealPath: async () => ok(),
|
||||||
|
openExternal: async () => ok(),
|
||||||
|
|
||||||
|
// ——— 剪贴板 ———
|
||||||
|
copyFile: async () => ok(),
|
||||||
|
readClipboard: async () => '',
|
||||||
|
writeClipboard: async () => ok(),
|
||||||
|
|
||||||
|
// ——— 事件订阅(真实主进程里由 IPC 推来)———
|
||||||
|
onCommand: () => {},
|
||||||
|
onCloseConfirm: () => {},
|
||||||
|
onExport: () => {},
|
||||||
|
saveFinished: () => {},
|
||||||
|
exportDocs: async () => ok(),
|
||||||
|
};
|
||||||
|
})();
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
// 用真实界面截三张图:浅色分栏 / 深色分栏 / 查找高亮
|
||||||
|
import fs from 'node:fs';
|
||||||
|
|
||||||
|
const BASE = 'http://127.0.0.1:8901/index.html';
|
||||||
|
const OUT = '/tmp/shots/out';
|
||||||
|
fs.mkdirSync(OUT, { recursive: true });
|
||||||
|
|
||||||
|
const list = await (await fetch('http://127.0.0.1:9222/json/list')).json();
|
||||||
|
const page = list.find((t) => t.type === 'page');
|
||||||
|
if (!page) { console.error('没有 page target'); process.exit(1); }
|
||||||
|
|
||||||
|
const ws = new WebSocket(page.webSocketDebuggerUrl);
|
||||||
|
let seq = 0;
|
||||||
|
const pending = new Map();
|
||||||
|
const send = (method, params = {}) => new Promise((res) => {
|
||||||
|
const id = ++seq;
|
||||||
|
pending.set(id, res);
|
||||||
|
ws.send(JSON.stringify({ id, method, params }));
|
||||||
|
});
|
||||||
|
ws.addEventListener('message', (ev) => {
|
||||||
|
const m = JSON.parse(ev.data);
|
||||||
|
if (m.id && pending.has(m.id)) { pending.get(m.id)(m.result || m.error); pending.delete(m.id); }
|
||||||
|
});
|
||||||
|
await new Promise((r) => ws.addEventListener('open', r, { once: true }));
|
||||||
|
|
||||||
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||||
|
const evaluate = async (expression) => {
|
||||||
|
const r = await send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true });
|
||||||
|
if (r && r.exceptionDetails) console.error(' JS 错误:', JSON.stringify(r.exceptionDetails).slice(0, 200));
|
||||||
|
return r && r.result ? r.result.value : undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
await send('Page.enable');
|
||||||
|
await send('Emulation.setDeviceMetricsOverride', {
|
||||||
|
width: 1440, height: 900, deviceScaleFactor: 2, mobile: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const shots = [
|
||||||
|
{ name: 'shot-split', q: '?theme=light&mode=split', after: null },
|
||||||
|
{ name: 'shot-dark', q: '?theme=dark&mode=split', after: null },
|
||||||
|
{ name: 'shot-read', q: '?theme=light&mode=read', after: null },
|
||||||
|
{
|
||||||
|
name: 'shot-find', q: '?theme=light&mode=split',
|
||||||
|
after: `
|
||||||
|
document.getElementById('btn-find').click();
|
||||||
|
const fi = document.getElementById('find-input');
|
||||||
|
fi.value = '安装包';
|
||||||
|
fi.dispatchEvent(new Event('input', { bubbles: true }));
|
||||||
|
document.getElementById('find-next').click();
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const s of shots) {
|
||||||
|
await send('Page.navigate', { url: BASE + s.q });
|
||||||
|
await sleep(1400);
|
||||||
|
// 走真实代码路径打开文件(mock 的 api.open 返回样例文档)
|
||||||
|
await evaluate("document.getElementById('btn-open').click()");
|
||||||
|
await sleep(2800);
|
||||||
|
if (s.after) { await evaluate(s.after); await sleep(600); }
|
||||||
|
const dims = await evaluate("JSON.stringify({tabs: document.querySelectorAll('.tab').length, text: document.getElementById('editor').value.length, ol: document.getElementById('ol-body').children.length})");
|
||||||
|
console.log(` ${s.name} → ${dims}`);
|
||||||
|
const shot = await send('Page.captureScreenshot', { format: 'png' });
|
||||||
|
fs.writeFileSync(`${OUT}/${s.name}.png`, Buffer.from(shot.data, 'base64'));
|
||||||
|
console.log(` ✓ ${s.name}.png ${(fs.statSync(`${OUT}/${s.name}.png`).size / 1024).toFixed(0)}KB`);
|
||||||
|
}
|
||||||
|
|
||||||
|
ws.close();
|
||||||