summary refs log tree commit diff stats
path: root/makefile
diff options
context:
space:
mode:
authorCase Duckworth2015-03-26 19:46:45 -0700
committerCase Duckworth2015-03-26 19:46:45 -0700
commitc654151582a77a0b459e3f55b687e43a32d4b67d (patch)
tree6d5d5d2b5f5650b494318e66cef6135b32c0cc72 /makefile
parentFlatten directory structure (diff)
downloadautocento-c654151582a77a0b459e3f55b687e43a32d4b67d.tar.gz
autocento-c654151582a77a0b459e3f55b687e43a32d4b67d.zip
Add HAPAX LEGOMENA support & flatten structure
The list of hapax legomena for this project is available at /hapax.html.

In addition, the directory structure has been further flattened.
All assets (javascript, lua, images, fonts) are in /trunk/.

One other thing was to update the makefile.
It compiles hapax.txt from rivers.
Diffstat (limited to 'makefile')
-rw-r--r--makefile73
1 files changed, 54 insertions, 19 deletions
diff --git a/makefile b/makefile index 34eda34..be0806a 100644 --- a/makefile +++ b/makefile
@@ -3,19 +3,35 @@
3# inspired by Lincoln Mullen | lincolnmullen.com 3# inspired by Lincoln Mullen | lincolnmullen.com
4 4
5# Define directories, file lists, and options 5# Define directories, file lists, and options
6HTMLs := $(patsubst %.txt,%.html,$(wildcard *.txt)) 6TEXTs := $(wildcard *.txt)
7HTMopts = --template=.template.html 7
8HTMLbl := index.html template.html index-txt.html
9HTMLs := $(filter-out $(HTMLbl),$(patsubst %.txt,%.html,$(TEXTs)))
10HTMopts = --template=template.html
8HTMopts+= --smart --mathml --section-divs 11HTMopts+= --smart --mathml --section-divs
9RIVERer = lua/river.lua 12
10RIVERs := $(patsubst %.txt,%.river,$(wildcard *.txt)) 13HAPAXbl:= first-lines.river common-titles.river hapax.river
11RIVopts = 14RIVERer = trunk/river.lua
12LOZENGE = js/lozenge.js 15RIVERs := $(filter-out $(HAPAXbl),$(patsubst %.txt,%.river,$(TEXTs)))
13 16
14# Do everything 17HAPAXs := $(filter-out $(HAPAXbl),$(RIVERs))
15.PHONY: all html river lozenge 18HAPAXer = trunk/hapax.lua
16all : html river lozenge 19HAPAXhd = trunk/hapax.head
20HAPAXtmp= hapax.tmp
21HAPAX = hapax.txt
22
23LOZENGE = trunk/lozenge.js
24
25.PHONY: all
26all : hapax html river lozenge
27
28.PHONY: hapax
29hapax : $(HAPAX)
30.PHONY: html
17html : $(HTMLs) 31html : $(HTMLs)
32.PHONY: river
18river : $(RIVERs) 33river : $(RIVERs)
34.PHONY: lozenge
19lozenge : $(LOZENGE) 35lozenge : $(LOZENGE)
20 36
21# Generic rule for HTML targets and Markdown sources 37# Generic rule for HTML targets and Markdown sources
@@ -27,15 +43,34 @@ lozenge : $(LOZENGE)
27 @echo River-ing $@ 43 @echo River-ing $@
28 @sed -e '/^---$$/,/^...$$/d'\ 44 @sed -e '/^---$$/,/^...$$/d'\
29 -e "s/[^][A-Za-z0-9\/\"':.-]/ /g" $< |\ 45 -e "s/[^][A-Za-z0-9\/\"':.-]/ /g" $< |\
30 pandoc - -f markdown -t $(RIVERer) $(RIVopts) -o $@ 46 pandoc - -f markdown -t $(RIVERer) -o $@
31 47
32$(LOZENGE) : $(HTMLs) 48$(LOZENGE) : $(HTMLs)
33 @echo "Updating lozenge.js..." 49 @echo "Updating lozenge.js..."
34 @list=`ls *.html |\ 50 @list=`echo $(HTMLs) |\
35 sed -e 's,../,,g' |\ 51 sed -e 's/\(\S\+.html\) \?/"\1",/g'\
36 tr '\n' ' ' |\ 52 -e 's/^\(.*\),$$/var files=[\1]/'` &&\
37 sed -e 's/\(\S\+.html\) /"\1",/g'\ 53 sed -i "s/var files=.*/$$list/" $(LOZENGE)
38 -e 's/^\(.*\),$$/var files=[\1]/'` &&\ 54
39 sed -i "s/var files=.*/$$list/" $(LOZENGE) 55$(HAPAX) : $(RIVERs) $(HAPAXhd)
40# TODO: add compiling hapax 56 -rm -f $(HAPAXbl)
41# TODO: add first line compiler 57 @echo "Compiling $(HAPAX)..."
58 pandoc -f markdown -t $(HAPAXer) -o $(HAPAX) *.river
59 @echo -n "Linking $(HAPAX)..."
60 @cat $(HAPAXhd) > $(HAPAXtmp) &&\
61 for word in `sort hapax.txt`; do\
62 file=`grep -liwq "^$$word$$" *.river | grep -v '$(HAPAX)'`;\
63 echo "[$$word](`basename $$file river`html)">>$(HAPAXtmp);\
64 echo -n '.';\
65 done && mv $(HAPAXtmp) $(HAPAX)
66 @echo "Done."
67
68# TODO: Add indices compilers (first-lines, common-titles)
69
70.PHONY: clean
71clean:
72 -rm -f hapax.txt hapax.tmp *.river
73 -rm -f $(HTMLs)
74
75.PHONY: again
76again: clean all