1
0
Files
plaintextaccounting/Makefile
Simon Michael b6bf2ee405 a combined quick reference, aka "rosetta stone"
Covers the essentials of Ledger/hledger/Beancount journal format.
The master copy is in google docs for easier table editing,
but this will likely change in future.
2016-03-14 08:49:45 -07:00

35 lines
1.5 KiB
Makefile

all: mdtohtml
mdtohtml: $(patsubst %.md,%.html,$(wildcard *.md)) Makefile
watch:
fswatch -l 0.1 -0 *.{md,tmpl} | xargs -0 -n1 -I{} make all
livereload:
livereloadx -p 10000 --static .
clean:
rm -f $(patsubst %.md,%.html,$(wildcard *.md))
PANDOC = pandoc # --from markdown --to html
# index.html: index.md index.tmpl
# $(PANDOC) --template index.tmpl index.md -o $@
%.html: %.md index.tmpl
$(PANDOC) --template index.tmpl $< -o $@
quickref/index.html:
rm -rf quickref/QuickReferencefortheLedger-Likes
-mv ~/Desktop/QuickReferencefortheLedger-Likes quickref
cp quickref/QuickReferencefortheLedger-Likes/images/* quickref/images
cp quickref/QuickReferencefortheLedger-Likes/QuickReferencefortheLedgerLikes.html quickref/index.html
perl -p -i -e 's%<style.*</style>%<meta name="viewport" content="width=device-width, initial-scale=1"><link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css"><link rel="stylesheet" href="css/normalize.css"><link rel="stylesheet" href="css/skeleton.css"><link rel="stylesheet" href="css/site.css"><link rel="icon" type="image/png" href="images/favicon.png"><link href="quickref.css" rel="stylesheet">%' $@
perl -p -i -e 's/>/>\n/g' $@
perl -p -i -e 's/(<body .*)/\1\n<div class="container">/' $@
perl -p -i -e 's/<\/body>/<\/div>\n<\/body>/' $@
# XXX not working
# watch-quickref:
# fswatch -l 0.1 -0 ~/Desktop/QuickReferencefortheLedger-Likes/QuickReferencefortheLedgerLikes.html | xargs -0 -n1 -I{} cat #echo make quickref.html