-
Notifications
You must be signed in to change notification settings - Fork 135
/
Copy pathMakefile
45 lines (32 loc) · 1.07 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
# REMOTE is the name of the git remote that hosts
# https://github.com/cs3110/textbook. The gh-pages branch there is
# automatically served by https://cs3110.github.io/textbook.
REMOTE=origin
BOOK=src
HTML=${BOOK}/_build/html
LATEX=${BOOK}/_build/latex
PDF_NAME=ocaml_programming.pdf
default: html
clean:
jupyter-book clean ${BOOK}
html:
OPAMSWITCH=textbook jupyter-book build ${BOOK}
html-strict:
jupyter-book build -W ${BOOK}
linkcheck:
jupyter-book build ${BOOK} --builder linkcheck
view:
open ${HTML}/index.html
pdf:
jupyter-book build src --builder pdflatex
view-pdf:
open ${LATEX}/book.pdf
deploy: html pdf
cp ${LATEX}/book.pdf ${HTML}/${PDF_NAME} \
&& ghp-import -n -p -f ${HTML} -r ${REMOTE} -m "Update textbook"
wc:
find src/chapters -type f -name "*.md" -exec cat {} \; | pandoc -f commonmark -t plain | wc -w
wcl:
find -E src/chapters -type f -name "*.md" -exec pandoc --lua-filter wordcount.lua {} \; | awk '{s+=$$1} END {print s}'
ccl:
find -E src/chapters -type f -name "*.md" -exec pandoc --lua-filter codecount.lua {} \; | awk '{s+=$$1} END {print s}'