1
0

makefile cleanups

This commit is contained in:
Simon Michael
2023-11-28 01:03:24 -10:00
parent 148b59454b
commit d8ad51442c

View File

@@ -1,7 +1,6 @@
all: html
# Generate html from all md files in src/, in out/
# (including README, maybe useful for local preview. $(filter-out README.md, ...) to exclude).
html: $(patsubst src/%,out/%,$(patsubst %.md,%.html,$(wildcard src/*.md src/quickref/*.md))) Makefile
PANDOC=pandoc \
@@ -15,6 +14,8 @@ out/%.html: src/%.md page.tmpl
# regenerate html whenever an md file changes
html-auto auto:
watchexec -- make html
# no different:
# watchexec --ignore-file=page.tmpl -- make html
BROWSE=open
LIVERELOADPORT=8100
@@ -29,22 +30,6 @@ html-watch watch:
(sleep 1; $(BROWSE) http://localhost:$(LIVERELOADPORT)/) &
$(LIVERELOAD) out
# regenerate syntax quick reference html from google docs html export
# (it has been manually edited, let's not do this again)
#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
clean:
rm -f $(patsubst %.md,%.html,$(wildcard *.md))