forked from ROS-Spanish-Users-Group/ros2_documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (37 loc) · 1.33 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
# Make file to generate documentation
SOURCE = source
OUT = build
LINKCHECKDIR = $(OUT)/linkcheck
BUILD = python3 -m sphinx
OPTS =-c .
PUBLISHDIR = /tmp/ros2_doc
help:
@$(BUILD) -M help "$(SOURCE)" "$(OUT)" $(OPTS)
@echo " multiversion to build documentation for all branches"
multiversion: Makefile
sphinx-multiversion $(OPTS) "$(SOURCE)" build/html
@echo "<html><head><meta http-equiv=\"refresh\" content=\"0; url=humble/index.html\" /></head></html>" > build/html/index.html
python3 make_sitemapindex.py
%: Makefile
@$(BUILD) -M $@ "$(SOURCE)" "$(OUT)" $(OPTS)
publish:
git clone --reference . https://github.com/ROS-Spanish-Users-Group/ros2_documentation.git $(PUBLISHDIR)
cd $(PUBLISHDIR) && \
git checkout gh-pages && \
git config user.email "[email protected]" && \
git config user.name "fmrico"
rm -fr $(PUBLISHDIR)/*
cp -r $(OUT)/html/* $(PUBLISHDIR)
cp scripts/.nojekyll $(PUBLISHDIR)/.nojekyll
# cp scripts/CNAME $(PUBLISHDIR)/CNAME
cd $(PUBLISHDIR) && \
git add -A && \
git diff-index --quiet HEAD || \
(git commit -s -m "[skip ci] publish $(RELEASE)" && git push origin)
test:
doc8 --ignore D001 --ignore-path build
linkcheck:
$(BUILD) -b linkcheck $(OPTS) $(SOURCE) $(LINKCHECKDIR)
@echo
@echo "Check finished. Report is in $(LINKCHECKDIR)."
.PHONY: help Makefile multiversion test linkcheck