-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (55 loc) · 1.7 KB
/
Makefile
File metadata and controls
65 lines (55 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# 《解密 Claude Code》书籍构建
# ================================
#
# make — 构建 HTML 并在浏览器中打开
# make pdf — 构建 PDF
# make epub — 构建 EPUB
# make all — 构建所有格式
# make serve — 启动本地预览服务器
# make clean — 清理构建产物
.PHONY: web pdf epub all serve clean help
# 默认目标:构建 HTML 并打开浏览器
web: html open
html:
@./build.sh html
open: html
@echo "[INFO] 在浏览器中打开..."
@if command -v open >/dev/null 2>&1; then \
open build/index.html; \
elif command -v xdg-open >/dev/null 2>&1; then \
xdg-open build/index.html; \
elif command -v start >/dev/null 2>&1; then \
start build/index.html; \
else \
echo "[INFO] 请手动打开 build/index.html"; \
fi
pdf:
@./build.sh pdf
epub:
@./build.sh epub
all:
@./build.sh all
serve:
@./build.sh web
clean:
@./build.sh clean
help:
@echo ""
@echo " 《解密 Claude Code》构建系统"
@echo " =========================="
@echo ""
@echo " make 构建 HTML 并在浏览器中打开(默认)"
@echo " make pdf 构建 PDF(需要 pandoc + LaTeX 或 weasyprint)"
@echo " make epub 构建 EPUB(需要 pandoc)"
@echo " make all 构建所有格式"
@echo " make serve 启动本地 Web 预览服务器(localhost:8000)"
@echo " make clean 清理构建产物"
@echo " make help 显示此帮助"
@echo ""
@echo " 依赖安装:"
@echo " brew install pandoc # Markdown 转换"
@echo " brew install --cask mactex-no-gui # PDF (LaTeX)"
@echo " pip3 install weasyprint # PDF (备选)"
@echo ""
@echo " 输出目录: build/"
@echo ""