-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (47 loc) · 1.8 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
WHITELIST := 'README\|Makefile\|resources/'
CHAPTERS := README.md dependencies/TOC.md \
$(shell sed -n '/^[^ ;].*|/ s|^\([^ ]*\).*|resources/markdown/\1.md|p' \
resources/markdown/TOC.md)
all: html pdf todo
html:
@ grep -v '^;' resources/markdown/TOC.md | sed 's/.*|//' > dependencies/TOC.md
@ cat resources/html/head.html > index.html
@ resources/scripts/wrapchapters.sh pandoctor $(CHAPTERS) >> index.html
@ cat resources/html/footer.html >> index.html
pdf:
@ sed 's/^----$$/\\pagebreak/' $(CHAPTERS) | pandoc -V geometry:margin=1.5in -o workshop.pdf
display: html
@ ./resources/scripts/chromereload index.html
devel:
open index.html
commando -p cat -q -j \
| grep --line-buffered -v 'dependencies/' \
| grep --line-buffered -v 'dot/' \
| grep --line-buffered -v 'git' \
| grep --line-buffered $(WHITELIST) \
| uniqhash \
| conscript make display
todo: unchecked_examples
@ grep -ni todo $(CHAPTERS) | cat
publish:
make
git add -A .
@ echo "Commit Message:"
@ read message; \
git commit -m "Publishing - $$message"
git push
git push origin master:gh-pages
dependencies:
mkdir -p dependencies
git clone [email protected]:sordina/Commando.git dependencies/commando
git clone [email protected]:sordina/Conscript.git dependencies/conscript
git clone [email protected]:sordina/pandoctor.git dependencies/pandoctor
git clone [email protected]:sordina/uniqhash.git dependencies/uniqhash
cd dependencies/commando && cabal install
cd dependencies/conscript && cabal install
cd dependencies/pandoctor && cabal install
cd dependencies/uniqhash && cabal install
clean:
rm -rf dependencies
unchecked_examples:
@ grep -n 'data-language=haskell' $(CHAPTERS) | grep -v check | cat