From 2ab11ccdc11771dcb1157a57450bf33d9ceb6c56 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Tue, 25 Nov 2025 12:58:51 +0100 Subject: Finish the Makefile to generate the planners. --- planner/Makefile | 67 ++++- planner/templates/daily-A5-graph-r.svg | 463 ---------------------------- planner/templates/daily-A5-graph-v.svg | 463 ---------------------------- planner/templates/daily-A5-points4mm-r.svg | 312 ------------------- planner/templates/daily-A5-points4mm-v.svg | 463 ---------------------------- planner/templates/daily-graph-A5-r.svg | 463 ++++++++++++++++++++++++++++ planner/templates/daily-graph-A5-v.svg | 463 ++++++++++++++++++++++++++++ planner/templates/daily-points4mm-A5-r.svg | 312 +++++++++++++++++++ planner/templates/daily-points4mm-A5-v.svg | 463 ++++++++++++++++++++++++++++ planner/templates/daily-ruled-A5-r.svg | 464 ++++++++++++++++++++++++++++ planner/templates/daily-ruled-A5-v.svg | 465 +++++++++++++++++++++++++++++ 11 files changed, 2690 insertions(+), 1708 deletions(-) delete mode 100644 planner/templates/daily-A5-graph-r.svg delete mode 100644 planner/templates/daily-A5-graph-v.svg delete mode 100644 planner/templates/daily-A5-points4mm-r.svg delete mode 100644 planner/templates/daily-A5-points4mm-v.svg create mode 100644 planner/templates/daily-graph-A5-r.svg create mode 100644 planner/templates/daily-graph-A5-v.svg create mode 100644 planner/templates/daily-points4mm-A5-r.svg create mode 100644 planner/templates/daily-points4mm-A5-v.svg create mode 100644 planner/templates/daily-ruled-A5-r.svg create mode 100644 planner/templates/daily-ruled-A5-v.svg diff --git a/planner/Makefile b/planner/Makefile index fbfbac8..3f47ae4 100644 --- a/planner/Makefile +++ b/planner/Makefile @@ -1,20 +1,73 @@ DESTDIR = dest -LANG_NAME := $(if $(LANG_NAME),$(LANG_NAME),en) +LANG_NAME := $(shell echo $(LANG) | cut -c 1-2 ) + +LATITUDE ?= "45.81478" +LONGITUDE ?= "9.07522" +TIMEZONE ?= "Europe/Rome" PDF_TARGETS = $(patsubst templates/%-v.svg,$(DESTDIR)/%-$(LANG_NAME).pdf,$(wildcard templates/*-v.svg)) NUP2_TARGETS = $(patsubst templates/%-v.svg,$(DESTDIR)/%-$(LANG_NAME)-book.pdf,$(wildcard templates/*-A5*-v.svg)) NUP4_TARGETS = $(patsubst templates/%-v.svg,$(DESTDIR)/%-$(LANG_NAME)-book.pdf,$(wildcard templates/*-A6*-v.svg)) -.PHONY: all pdf nup clean +.PHONY: all pdf nup clean distclean all: pdf nup pdf: $(PDF_TARGETS) nup: $(NUP4_TARGETS) $(NUP2_TARGETS) -$(DESTDIR)/%-$(LANG_NAME).pdf: TEMPLATE_NAME = $(subst -$(LANG_NAME),,$(basename $(notdir $@))) -$(DESTDIR)/%-$(LANG_NAME).pdf: templates/%-r.svg templates/%-v.svg templates/cover*.svg - echo ./planner_generator.py --template $(TEMPLATE_NAME) `echo $(TEMPLATE_NAME) | awk -F "i[-_]" '{print $1}'` +debug: + echo $(LANG_NAME) + +# Individual designs + +$(DESTDIR)/daily-95×186-$(LANG_NAME).pdf: templates/daily-95×186-r.svg templates/daily-95×186-v.svg templates/cover-95×186-r.svg planner_generator.py + mkdir -p $(DESTDIR) + ./planner_generator.py --template daily-95×186 --cover-template cover-95×186-r.svg daily --outdir $(DESTDIR) + +$(DESTDIR)/daily-graph-A5-$(LANG_NAME).pdf: templates/daily-graph-A5-r.svg templates/daily-graph-A5-v.svg templates/cover-A5-r.svg planner_generator.py + ./planner_generator.py --template daily-graph-A5 --outdir $(DESTDIR) daily + +$(DESTDIR)/daily-points4mm-A5-$(LANG_NAME).pdf: templates/daily-points4mm-A5-r.svg templates/daily-points4mm-A5-v.svg templates/cover-A5-r.svg planner_generator.py + ./planner_generator.py --template daily-points4mm-A5 --outdir $(DESTDIR) daily + +$(DESTDIR)/daily-ruled-A5-$(LANG_NAME).pdf: planner_generator.py templates/daily-ruled-A5-r.svg templates/daily-ruled-A5-r.svg templates/cover-A5-r.svg + ./planner_generator.py --template daily-ruled-A5 --outdir $(DESTDIR) daily + +$(DESTDIR)/daily-A5-$(LANG_NAME).pdf: planner_generator.py templates/daily-A5-r.svg templates/daily-A5-v.svg templates/cover-A5-r.svg + ./planner_generator.py --template daily-A5 --outdir $(DESTDIR) daily + +$(DESTDIR)/daily-A6-$(LANG_NAME).pdf: planner_generator.py templates/daily-A6-r.svg templates/daily-A6-v.svg templates/cover-A6-r.svg + ./planner_generator.py --template daily-A6 --outdir $(DESTDIR) daily + +$(DESTDIR)/month-A6-$(LANG_NAME).pdf: planner_generator.py templates/month-A6-r.svg templates/month-A6-v.svg + ./planner_generator.py --template month-A6 --outdir $(DESTDIR) month + +$(DESTDIR)/week_health-A6-$(LANG_NAME).pdf: planner_generator.py templates/week_health-A6-r.svg templates/week_health-A6-v.svg templates/cover-A6-r.svg + ./planner_generator.py --template week_health-A6 --latitude $(LATITUDE) --longitude $(LONGITUDE) --timezone $(TIMEZONE) --outdir $(DESTDIR) ephemerisbiweekly + +$(DESTDIR)/week_on_one_page-A6-$(LANG_NAME).pdf: planner_generator.py templates/week_on_one_page-A6-r.svg templates/week_on_one_page-A6-v.svg templates/cover-A6-r.svg + ./planner_generator.py --template week_on_one_page-A6 --latitude $(LATITUDE) --longitude $(LONGITUDE) --timezone $(TIMEZONE) --outdir $(DESTDIR) ephemerisbiweekly + +$(DESTDIR)/week_on_one_page_dots-A6-$(LANG_NAME).pdf: planner_generator.py templates/week_on_one_page_dots-A6-r.svg templates/week_on_one_page_dots-A6-v.svg templates/cover-A6-r.svg + ./planner_generator.py --template week_on_one_page_dots-A6 --outdir $(DESTDIR) biweekly + +$(DESTDIR)/week_on_two_pages-A6-$(LANG_NAME).pdf: planner_generator.py templates/week_on_two_pages-A6-r.svg templates/week_on_two_pages-A6-v.svg templates/cover-A6-r.svg + ./planner_generator.py --template week_on_two_pages-A6 --outdir $(DESTDIR) weekly + +$(DESTDIR)/%-$(LANG_NAME).pdf: + echo "building $@ is not supported yet" + + +# nup-ping + +$(DESTDIR)/%-A5-$(LANG_NAME)-book.pdf: $(DESTDIR)/%-A5-$(LANG_NAME).pdf + ../page_manipulation/a5_book.py $^ + +$(DESTDIR)/%-A6-$(LANG_NAME)-book.pdf: $(DESTDIR)/%-A6-$(LANG_NAME).pdf + ../page_manipulation/a6_book.py $^ -$(DESTDIR)/%-$(LANG_NAME)-book.pdf: $(DESTDIR)/%-$(LANG_NAME).pdf - echo $@ +clean: + rm build/* +distclean: + rm $(DESTDIR)/* diff --git a/planner/templates/daily-A5-graph-r.svg b/planner/templates/daily-A5-graph-r.svg deleted file mode 100644 index 593c5a2..0000000 --- a/planner/templates/daily-A5-graph-r.svg +++ /dev/null @@ -1,463 +0,0 @@ - - - - - - - - - - - - - - {{ day.strftime("%d %B %Y").strip('0') }} - {{ day.strftime("%A") }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/planner/templates/daily-A5-graph-v.svg b/planner/templates/daily-A5-graph-v.svg deleted file mode 100644 index e7e7297..0000000 --- a/planner/templates/daily-A5-graph-v.svg +++ /dev/null @@ -1,463 +0,0 @@ - - - - - - - - - - - - - - {{ day.strftime("%d %B %Y").strip('0') }} - {{ day.strftime("%A") }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/planner/templates/daily-A5-points4mm-r.svg b/planner/templates/daily-A5-points4mm-r.svg deleted file mode 100644 index 418e4e2..0000000 --- a/planner/templates/daily-A5-points4mm-r.svg +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - {{ day.strftime("%d %B %Y").strip('0') }} - {{ day.strftime("%A") }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/planner/templates/daily-A5-points4mm-v.svg b/planner/templates/daily-A5-points4mm-v.svg deleted file mode 100644 index 8f204c0..0000000 --- a/planner/templates/daily-A5-points4mm-v.svg +++ /dev/null @@ -1,463 +0,0 @@ - - - - - - - - - - - - - - {{ day.strftime("%d %B %Y").strip('0') }} - {{ day.strftime("%A") }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/planner/templates/daily-graph-A5-r.svg b/planner/templates/daily-graph-A5-r.svg new file mode 100644 index 0000000..593c5a2 --- /dev/null +++ b/planner/templates/daily-graph-A5-r.svg @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + {{ day.strftime("%d %B %Y").strip('0') }} + {{ day.strftime("%A") }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/planner/templates/daily-graph-A5-v.svg b/planner/templates/daily-graph-A5-v.svg new file mode 100644 index 0000000..e7e7297 --- /dev/null +++ b/planner/templates/daily-graph-A5-v.svg @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + {{ day.strftime("%d %B %Y").strip('0') }} + {{ day.strftime("%A") }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/planner/templates/daily-points4mm-A5-r.svg b/planner/templates/daily-points4mm-A5-r.svg new file mode 100644 index 0000000..418e4e2 --- /dev/null +++ b/planner/templates/daily-points4mm-A5-r.svg @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + {{ day.strftime("%d %B %Y").strip('0') }} + {{ day.strftime("%A") }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/planner/templates/daily-points4mm-A5-v.svg b/planner/templates/daily-points4mm-A5-v.svg new file mode 100644 index 0000000..8f204c0 --- /dev/null +++ b/planner/templates/daily-points4mm-A5-v.svg @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + {{ day.strftime("%d %B %Y").strip('0') }} + {{ day.strftime("%A") }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/planner/templates/daily-ruled-A5-r.svg b/planner/templates/daily-ruled-A5-r.svg new file mode 100644 index 0000000..6fcb8f5 --- /dev/null +++ b/planner/templates/daily-ruled-A5-r.svg @@ -0,0 +1,464 @@ + + + + + + + + + + + + + + {{ day.strftime("%d %B %Y").strip('0') }} + {{ day.strftime("%A") }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/planner/templates/daily-ruled-A5-v.svg b/planner/templates/daily-ruled-A5-v.svg new file mode 100644 index 0000000..734dbeb --- /dev/null +++ b/planner/templates/daily-ruled-A5-v.svg @@ -0,0 +1,465 @@ + + + + + + + + + + + + + + {{ day.strftime("%d %B %Y").strip('0') }} + {{ day.strftime("%A") }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3