yinji/README.md

83 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 印迹Yinji
印迹是本地运行的 PDF 印章工具。普通章、骑缝章、签名、批量处理都在浏览器里完成,文件不会上传到服务器。
## 本地运行
```bash
cd /home/parallels/Projects/yinji
python3 -m http.server 8123
```
打开 `http://127.0.0.1:8123/index.html`
## 目录
- `index.html`:页面入口
- `src/main.js`:应用入口和装配逻辑
- `src/core/`:状态、设置、印章库、批量处理
- `src/modules/`PDF、画布、导出、辅助线等功能
- `src/features/`:从入口拆出的业务功能
- `src/ui/`:弹窗、通知、加载等界面模块
- `src/style.css`:样式入口
- `src/styles/`:样式拆分文件
- `tools/ai/`:给 AI 或 CLI 用的自动化脚本
## 常用验证
语法检查:
```bash
node --check src/main.js
```
界面冒烟:
```bash
node tools/ai/yinji-cli.mjs smoke --pdf ./test-fixture.pdf
```
导出当前状态快照:
```bash
node tools/ai/yinji-cli.mjs state --pdf ./test-fixture.pdf --seal demo --add-seal
```
验证手写签名:
```bash
node tools/ai/yinji-cli.mjs state --pdf ./test-fixture.pdf --add-signature-demo
```
验证批量队列:
```bash
node tools/ai/yinji-cli.mjs state --tab export --batch-pdf ./test-fixture.pdf --batch-pdf ./test-multi.pdf
```
验证批量处理界面流程:
```bash
node tools/ai/yinji-cli.mjs state --seal demo --tab export --batch-pdf ./test-fixture.pdf --process-batch
```
截图:
```bash
node tools/ai/yinji-cli.mjs capture --pdf ./test-fixture.pdf --seal demo --add-seal --output ./ui-check.png
```
## AI 协作
- 项目规则看 `AGENTS.md`
- 任务流程和验证路径看 `docs/AI_RUNBOOK.md`
- Codex skill 入口在 `.codex/skills/yinji/SKILL.md`
## 夹具
- `test-fixture.pdf`:单文件基本流程
- `test-multi.pdf`:多页或批量流程
## 旧文档
`docs/README.md` 保留旧版对外介绍。当前开发和验证以本文件为准。