From 5d7a2983e64433b49437c763539c148f765c1b5f Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 29 Nov 2023 08:04:42 -1000 Subject: [PATCH] workaround for pandoc not being present in Cloudflare Pages platform V2 part 9 --- Makefile | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 7fa1ae7..a6b9c0d 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,25 @@ -all: pandoc html pandoc-remove - -# XXX temporary workaround for pandoc not being present in Cloudflare Pages platform V2 -# pandoc --version || sudo apt install -y pandoc -pandoc: - pandoc --version || \ - wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-linux-amd64.tar.gz && \ - tar xzf pandoc-3.1.9-linux-amd64.tar.gz - -# Too large, cloudflare won't deploy -pandoc-remove: - rm -rf pandoc-3.1.9* - -#PANDOC=pandoc -PANDOC=pandoc-3.1.9/bin/pandoc \ - -f markdown-smart-tex_math_dollars+autolink_bare_uris+wikilinks_title_after_pipe \ - --lua-filter=fixwikilinks.lua +all: html # Generate html from all md files in src/, in out/ html: $(patsubst src/%,out/%,$(patsubst %.md,%.html,$(wildcard src/*.md src/quickref/*.md))) Makefile +PANDOC?=pandoc + +# temporary workaround for cloudflare pages (pandoc is too old in V1, missing in V2) +html-cfp: + pandoc --version || ( \ + wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-linux-amd64.tar.gz && \ + tar xzf pandoc-3.1.9-linux-amd64.tar.gz ) + make html PANDOC=pandoc-3.1.9/bin/pandoc + rm -rf pandoc-3.1.9* + +MD2HTML=$(PANDOC) \ + -f markdown-smart-tex_math_dollars+autolink_bare_uris+wikilinks_title_after_pipe \ + --lua-filter=fixwikilinks.lua + # generate html from a md file out/%.html: src/%.md page.tmpl - $(PANDOC) --template page.tmpl "$<" -o "$@" + $(MD2HTML) --template page.tmpl "$<" -o "$@" # regenerate html whenever an md file changes html-auto auto: