-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMakefile
71 lines (56 loc) · 1.52 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
# make commands to build html from markdown
#
# list with markdown files
MDS=$(shell find docs/* -name '*.md')
# pandoc variables
PDOUTDIR?=html/pandoc
PDHTMLS=$(patsubst %.md,$(PDOUTDIR)/%.html, $(MDS))
CSS=/css/pandoc.css
.PHONY : all
all :
@echo " available commands:"
@echo " make mkdocs"
@echo " make mkdocs-clean"
@echo " make pandoc"
@echo " make pandoc-clean"
.PHONY : pandoc
pandoc : $(PDHTMLS) $(PDOUTDIR)
cp -R fmt/pandoc/css $(PDOUTDIR)/docs/
.PHONY : pandoc-clean
pandoc-clean :
rm -rf $(PDOUTDIR)
.PHONY : pandoc-http
pandoc-http:
cd html/pandoc/docs && python -m SimpleHTTPServer
.PHONY : pandoc-http3
pandoc-http3:
cd html/pandoc/docs && python3 -m http.server
$(PDOUTDIR) :
mkdir -p $(PDOUTDIR)
$(PDOUTDIR)/%.html : %.md $(PDOUTDIR)
mkdir -p $$(dirname $@)
pandoc --toc --css $(CSS) --template fmt/pandoc/template.html --lua-filter=fmt/pandoc/links.lua -t html -f markdown -s $< -o $@
.PHONY : mkdocs
mkdocs :
mkdocs build -f fmt/mkdocs/mkdocs.yml
.PHONY : mkdocs-clean
mkdocs-clean :
rm -rf html/mkdocs
.PHONY : mdbook
mdbook:
rm -f docs/SUMMARY.md && cd docs && ln -s ../fmt/mdbook/SUMMARY.md && cd ..
mdbook build -d ../../html/mdbook fmt/mdbook
rm -f docs/SUMMARY.md
.PHONY : mdbook-serve
mdbook-serve:
rm -f docs/SUMMARY.md && cd docs && ln -s ../fmt/mdbook/SUMMARY.md && cd ..
mdbook serve --open -d ../../html/mdbook fmt/mdbook
rm -f docs/SUMMARY.md
.PHONY : mdbook-clean
mdbook-clean :
rm -rf html/mdbook
rm -f docs/SUMMARY.md
.PHONY : clean
clean :
rm -f docs/SUMMARY.md
rm -rf html