-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (41 loc) · 1.63 KB
/
Makefile
File metadata and controls
61 lines (41 loc) · 1.63 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
#
# A simple Makefile for generating a documentation site based on
# the Markdown documents and Pandoc.
#
PROJECT = cloud-init-examples
VERSION = $(shell grep '"version":' codemeta.json | cut -d\" -f 4)
RELEASE_HASH=$(shell git log --pretty=format:'%h' -n 1)
BRANCH = $(shell git branch | grep '* ' | cut -d\ -f 2)
MARKDOWN_PAGES =$(shell ls -1 *.md drafts/*.md | sed -E 's/\.md//g')
HTML_PAGES = $(shell ls -1 *.md | sed -E 's/\.md/.html/g')
build: CITATION.cff about.md $(HTML_PAGES) index.html about.html
CITATION.cff: codemeta.json
@cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
echo "" | pandoc --metadata title="Cite $(PROGRAM)" --metadata-file=_codemeta.json --template=codemeta-cff.tmpl >CITATION.cff
about.html: about.md
about.md: codemeta.json .FORCE
cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
echo "" | pandoc --metadata-file=_codemeta.json --template codemeta-md.tmpl >about.md 2>/dev/null
if [ -f _codemeta.json ]; then rm _codemeta.json; fi
index.html: README.md $(MARKDOWN_PAGES)
mv README.html index.html
$(HTML_PAGES): $(MARKDOWN_PAGES)
$(MARKDOWN_PAGES): .FORCE
pandoc -s --metadata title:"Multipass and Cloud Init Examples" \
--template page.tmpl \
$@.md > $@.html
status:
git status
save:
@if [ "$(msg)" != "" ]; then git commit -am "$(msg)"; else git commit -am "Quick Save"; fi
git push origin $(BRANCH)
website: .FORCE
make -f website.mak
publish: website .FORCE
./publish.bash
refresh:
git fetch origin
git pull origin $(BRANCH)
clean:
@rm *.html 2>&1
.FORCE: