diff options
author | Case Duckworth | 2015-03-25 21:49:45 -0700 |
---|---|---|
committer | Case Duckworth | 2015-03-25 21:54:26 -0700 |
commit | ecda49e0b20ad3bd52449356dccf2f8095ecfb70 (patch) | |
tree | 4789dd035fa827edf280fd8234d014b171de1c38 /makefile | |
parent | Fix makefile re: RIVER crashing (diff) | |
download | autocento-ecda49e0b20ad3bd52449356dccf2f8095ecfb70.tar.gz autocento-ecda49e0b20ad3bd52449356dccf2f8095ecfb70.zip |
Flatten directory structure
All content files (*.txt, *.html, *.river) are now in /. I did this to simplify the compilation step, and to make linking easier. I'm still thinking about whether I should move the contents of js/, img/, and lua/ into /, or into an 'assets' folder of some sort. We'll see.
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/makefile b/makefile new file mode 100644 index 0000000..34eda34 --- /dev/null +++ b/makefile | |||
@@ -0,0 +1,41 @@ | |||
1 | # Produce HTML & RIVER outputs with pandoc | ||
2 | # Case Duckworth | autocento.me | ||
3 | # inspired by Lincoln Mullen | lincolnmullen.com | ||
4 | |||
5 | # Define directories, file lists, and options | ||
6 | HTMLs := $(patsubst %.txt,%.html,$(wildcard *.txt)) | ||
7 | HTMopts = --template=.template.html | ||
8 | HTMopts+= --smart --mathml --section-divs | ||
9 | RIVERer = lua/river.lua | ||
10 | RIVERs := $(patsubst %.txt,%.river,$(wildcard *.txt)) | ||
11 | RIVopts = | ||
12 | LOZENGE = js/lozenge.js | ||
13 | |||
14 | # Do everything | ||
15 | .PHONY: all html river lozenge | ||
16 | all : html river lozenge | ||
17 | html : $(HTMLs) | ||
18 | river : $(RIVERs) | ||
19 | lozenge : $(LOZENGE) | ||
20 | |||
21 | # Generic rule for HTML targets and Markdown sources | ||
22 | %.html : %.txt | ||
23 | pandoc $< -f markdown -t html5 $(HTMopts) -o $@ | ||
24 | |||
25 | # Generic rule for RIVER targets and Markdown sources | ||
26 | %.river : %.txt | ||
27 | @echo River-ing $@ | ||
28 | @sed -e '/^---$$/,/^...$$/d'\ | ||
29 | -e "s/[^][A-Za-z0-9\/\"':.-]/ /g" $< |\ | ||
30 | pandoc - -f markdown -t $(RIVERer) $(RIVopts) -o $@ | ||
31 | |||
32 | $(LOZENGE) : $(HTMLs) | ||
33 | @echo "Updating lozenge.js..." | ||
34 | @list=`ls *.html |\ | ||
35 | sed -e 's,../,,g' |\ | ||
36 | tr '\n' ' ' |\ | ||
37 | sed -e 's/\(\S\+.html\) /"\1",/g'\ | ||
38 | -e 's/^\(.*\),$$/var files=[\1]/'` &&\ | ||
39 | sed -i "s/var files=.*/$$list/" $(LOZENGE) | ||
40 | # TODO: add compiling hapax | ||
41 | # TODO: add first line compiler | ||