forked from tsinghua-fib-lab/AgentSociety
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (47 loc) · 1.65 KB
/
Makefile
File metadata and controls
60 lines (47 loc) · 1.65 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
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXINTL ?= sphinx-intl
SOURCEDIR = docs
BUILDDIR = docs/_build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile gettext update-po build-po html-zh html-en html-all
# 国际化相关命令
# 提取需要翻译的文本
gettext:
@echo "提取可翻译的文本..."
$(SPHINXBUILD) -b gettext $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/gettext
# 更新翻译文件
update-po: gettext
@echo "更新翻译文件..."
$(SPHINXINTL) update -p $(BUILDDIR)/gettext -d $(SOURCEDIR)/locale -l en
# 编译翻译文件
build-po:
@echo "编译翻译文件..."
$(SPHINXINTL) build -d $(SOURCEDIR)/locale
# 构建中文文档(默认)
html-zh:
@echo "构建中文文档..."
$(SPHINXBUILD) -b html -D language=zh $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html/zh
# 构建英文文档
html-en: build-po
@echo "构建英文文档..."
$(SPHINXBUILD) -b html -D language=en $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html/en
# 构建所有语言版本
html-all: html-zh html-en
@echo "所有语言版本构建完成!"
# 默认构建中文版本
html: html-zh
# 清理构建文件
clean:
@echo "清理构建文件..."
rm -rf $(BUILDDIR)/*
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)