summary refs log tree commit diff stats
path: root/makefile
diff options
context:
space:
mode:
authorCase Duckworth2015-03-25 21:49:45 -0700
committerCase Duckworth2015-03-25 21:54:26 -0700
commitecda49e0b20ad3bd52449356dccf2f8095ecfb70 (patch)
tree4789dd035fa827edf280fd8234d014b171de1c38 /makefile
parentFix makefile re: RIVER crashing (diff)
downloadautocento-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--makefile41
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
6HTMLs := $(patsubst %.txt,%.html,$(wildcard *.txt))
7HTMopts = --template=.template.html
8HTMopts+= --smart --mathml --section-divs
9RIVERer = lua/river.lua
10RIVERs := $(patsubst %.txt,%.river,$(wildcard *.txt))
11RIVopts =
12LOZENGE = js/lozenge.js
13
14# Do everything
15.PHONY: all html river lozenge
16all : html river lozenge
17html : $(HTMLs)
18river : $(RIVERs)
19lozenge : $(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