PPT presentation 项目

Obsidian 技术日报/周报系统 — 新机器开荒指南

适用:Linux / macOS / Windows(WSL)
仓库:git@github.com:luduihang/MyObsidian.git


一、前置依赖

1.1 安装 Git + Node.js

macOS

# Git 自带,只需装 Homebrew 然后装 Node
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node git

Linux (Ubuntu/Debian)

sudo apt update && sudo apt install -y git curl
# Node.js 20 LTS
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

Windows:推荐 WSL2 + Ubuntu,然后按 Linux 步骤操作。原生 Windows 也可以但路径处理会有各种坑。

验证:

git --version   # ≥ 2.30
node --version  # ≥ 20
npm --version   # ≥ 10

1.2 配置 GitHub SSH

# 生成密钥(回车全部默认)
ssh-keygen -t ed25519 -C "你的邮箱@example.com"

# 复制公钥
cat ~/.ssh/id_ed25519.pub

把输出的内容添加到 GitHub → Settings → SSH and GPG keys → New SSH key。

验证:

ssh -T git@github.com
# 看到 "Hi luduihang!" 即成功

二、克隆仓库

# 克隆到 ~/Documents(macOS/Linux 通用)
mkdir -p ~/Documents
cd ~/Documents
git clone git@github.com:luduihang/MyObsidian.git "Obsidian Vault"

2.1 安装 Slidev 依赖

cd ~/Documents/Obsidian\ Vault/.presentation
npm ci

npm cipackage-lock.json 精确安装,比 npm install 更快更可复现。

2.2 可选:安装 Playwright(PPTX / PDF 导出用)

npx playwright install chromium

三、打开 Obsidian

  1. 下载安装 Obsidian
  2. 打开 → “Open folder as vault” → 选择 ~/Documents/Obsidian Vault
  3. 提示 “Safe mode” 时选择 Turn off Safe Mode(信任本仓库的插件配置)
  4. 插件会自动从 community-plugins.json 加载列表并安装

首次打开可能需要等几分钟让 Obsidian 下载插件。完成后侧边栏会出现 Git 状态图标。


四、验证系统可用

4.1 测试日报生成

cd ~/Documents/Obsidian\ Vault

# 用今天的笔记测试(如果没有,用任意一天)
node scripts/cli-report.js "我的工作量/2026年度/7月份/2026-07-08.md"

看到 ✅ 技术汇报已生成 即为成功。

4.2 预览幻灯片

cd .presentation && npx slidev --port 3030

浏览器打开 http://localhost:3030,应该看到 UESTC 主题的 PPT。

4.3 测试周报

# 在当前目录(Vault 根目录)运行
cd ~/Documents/Obsidian\ Vault

# 自定义区间
node scripts/cli-report.js --type weekly --from 2026-07-06 --to 2026-07-10

五、日常使用

5.1 写笔记

我的工作量/{年}年度/{月}月份/ 下创建日记,标题带 #汇报 的段落会进入 PPT:

## 项目开发 #汇报
- 完成了用户登录模块
- 修复了缓存 bug

## 日常杂务
- 给花浇水(← 不会进 PPT)

--- 在笔记里手动分页:

## 项目开发 #汇报
- 第 1 页的内容
---
- 第 2 页的内容

5.2 生成幻灯片

cd ~/Documents/Obsidian\ Vault

# 日报
node scripts/cli-report.js "我的工作量/2026年度/7月份/2026-07-08.md"

# 周报(自动 ISO 周)
node scripts/cli-report.js --type weekly "我的工作量/2026年度/7月份/2026-07-08.md"

# 周报(自定义区间)
node scripts/cli-report.js --type weekly --from 2026-07-06 --to 2026-07-10

5.3 预览

cd ~/Documents/Obsidian\ Vault/.presentation
npx slidev --port 3030 --remote
# → http://localhost:3030

5.4 导出

cd ~/Documents/Obsidian\ Vault/.presentation

# PDF
npx slidev export

# PPTX
npx slidev export --format pptx

六、多设备同步

本仓库已配置好自动同步,无需手动 git push/pull

时机 发生了什么
打开 Obsidian obsidian-git 插件自动 git pull
每 5 分钟 自动 git commit + git push
写完笔记切到浏览器 另一台设备已经能看到更新

同步依赖 obsidian-git 插件,已在 community-plugins.json 中配置,clone 后自动安装。

如果需要在 Obsidian 之外手动同步:

cd ~/Documents/Obsidian\ Vault
git pull   # 拉取远程更新
git push   # 推送本地更新

七、常见问题

Q: node scripts/cli-report.js 报 “Cannot find module”

确保在 Vault 根目录(~/Documents/Obsidian Vault)下运行,不是 .presentation/ 目录。

Q: Slidev 启动后页面空白

检查 .presentation/global-top.vue.presentation/public/uestc-logo.png 是否存在。首次 clone 应该都有。

Q: Mac 上报 “Obsidian Vault” 目录找不到

路径中的空格需要转义:

cd ~/Documents/Obsidian\ Vault
# 或者用引号
cd "/home/$(whoami)/Documents/Obsidian Vault"

Q: git clone 报 Permission denied

检查 SSH key 是否添加到 GitHub,以及 ssh -T git@github.com 是否成功。

Q: 想把 Vault 放在别的位置

可以放在任意位置,只要 scripts/cli-report.js 在 Vault 根目录运行就行。如果你用 iCloud/Dropbox 同步,注意 .presentation/node_modules 会导致大量小文件同步,建议把 Vault 放在非同步目录,用 Git 做唯一同步手段。


转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 kipleyarch@gmail.com