From 76a650d47e318b28f3b6cd6a6a038e8643dc8d36 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 1 Oct 2019 06:21:32 -1000 Subject: [PATCH] make: liverender -> html-auto, livereload -> html-watch --- Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cdefbac..62a26ee 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,21 @@ PANDOC=pandoc -f markdown-smart+autolink_bare_uris $(PANDOC) --template index.tmpl $< -o $@ # regenerate html whenever an md file changes -liverender: +html-auto: ls *.md | entr make html -# in a browser viewing localhost:10000/somepage.html, reload the page when somepage.html changes -livereload: - livereloadx -p 10000 --static . +BROWSE=open +LIVERELOADPORT=8100 +LIVERELOAD=livereloadx -p $(LIVERELOADPORT) -s + # --exclude '*.html' + # Exclude html files to avoid reloading browser as every page is generated. + # A reload happens at the end when the css/js files get copied. + +# Auto-regenerate html, and watch changes in a new browser window. +html-watch: + make html-auto & + (sleep 1; $(BROWSE) http://localhost:$(LIVERELOADPORT)/) & + $(LIVERELOAD) . # regenerate syntax quick reference html from google docs html export # (it has been manually edited, let's not do this again)