-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
81 lines (58 loc) · 2.64 KB
/
Makefile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# 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
SPHINXMULTIVERSION ?= sphinx-multiversion
SOURCEDIR_EN = en
SOURCEDIR_ZH = zh
SOURCEDIR = .
CONFDIR = .
CONFDIRRTT = rtt-config
BUILDDIR = _build
WEB_DOCS_BUILDER_URL ?= https://ai.b-bug.org/~zhengshanshan/web-docs-builder
TEMPLATE = _static/init_mermaid.js _static/mermaid.min.js _templates/versionsFlex.html _templates/Fleft.html _templates/Footer.html _templates/Fright.html _templates/layout.html _static/topbar.css _static/custom-theme.css
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
html: html-en html-zh html-zh-rtt html-en-rtt
html-en: Makefile $(TEMPLATE)
SPHINX_LANGUAGE=en $(SPHINXBUILD) -b html "$(SOURCEDIR_EN)" "$(BUILDDIR)/html/en" -c "$(CONFDIR)"
html-zh: Makefile $(TEMPLATE)
SPHINX_LANGUAGE=zh_CN $(SPHINXBUILD) -b html "$(SOURCEDIR_ZH)" "$(BUILDDIR)/html/zh" -c "$(CONFDIR)"
html-zh-rtt: Makefile $(TEMPLATE)
SPHINX_LANGUAGE=zh_CN $(SPHINXBUILD) -b html "$(SOURCEDIR_ZH)" "$(BUILDDIR)/html/zh/rtt" -c "$(CONFDIRRTT)"
html-en-rtt: Makefile $(TEMPLATE)
SPHINX_LANGUAGE=zh_CN $(SPHINXBUILD) -b html "$(SOURCEDIR_EN)" "$(BUILDDIR)/html/en/rtt" -c "$(CONFDIRRTT)"
mhtml: mhtml_cn mhtml_en mhtml_cn_rtt mhtml_en_rtt
mhtml_cn: $(TEMPLATE)
SPHINX_LANGUAGE=zh_CN $(SPHINXMULTIVERSION) "$(SOURCEDIR_ZH)" "$(BUILDDIR)/zh" $(SPHINXOPTS) -c "$(CONFDIR)"
mhtml_cn_rtt: $(TEMPLATE)
SPHINX_LANGUAGE=zh_CN $(SPHINXMULTIVERSION) "$(SOURCEDIR_ZH)" "$(BUILDDIR)/zh/rtt" $(SPHINXOPTS) -c "$(CONFDIRRTT)"
# 英文
mhtml_en: $(TEMPLATE)
SPHINX_LANGUAGE=en $(SPHINXMULTIVERSION) "$(SOURCEDIR_EN)" "$(BUILDDIR)/en" $(SPHINXOPTS) -c "$(CONFDIR)"
mhtml_en_rtt: $(TEMPLATE)
SPHINX_LANGUAGE=zh_CN $(SPHINXMULTIVERSION) "$(SOURCEDIR_EN)" "$(BUILDDIR)/en/rtt" $(SPHINXOPTS) -c "$(CONFDIRRTT)"
_templates:
mkdir $@
_templates/versionsFlex.html: _templates
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
_templates/layout.html: _templates
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
_templates/Fleft.html: _templates
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
_templates/Footer.html: _templates
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
_templates/Fright.html: _templates
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
_static/topbar.css:
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
_static/custom-theme.css:
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
_static/init_mermaid.js:
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@
_static/mermaid.min.js:
wget $(WEB_DOCS_BUILDER_URL)/$@ -O $@