]> git.g-eek.se Git - inbyggd-frihet-wiki.git/commitdiff
[cache] PDF compilation infrastructure
authorGustav Eek <gustav.eek@fripost.org>
Sun, 13 Oct 2019 19:18:15 +0000 (21:18 +0200)
committerGustav Eek <gustav.eek@fripost.org>
Sun, 13 Oct 2019 19:18:15 +0000 (21:18 +0200)
Add *Makefile* and Sed scripts for PDF-comilation via pandoc.

Also update *.gitignore*

cash/.gitignore [new file with mode: 0644]
cash/Makefile [new file with mode: 0644]
cash/sed/latex.sed [new file with mode: 0644]

diff --git a/cash/.gitignore b/cash/.gitignore
new file mode 100644 (file)
index 0000000..a136337
--- /dev/null
@@ -0,0 +1 @@
+*.pdf
diff --git a/cash/Makefile b/cash/Makefile
new file mode 100644 (file)
index 0000000..6331bde
--- /dev/null
@@ -0,0 +1,21 @@
+ALL = \
+  welcome-letter.pdf \
+  tutorial.pdf \
+
+all: $(ALL)
+
+OPTS = \
+  -s -f markdown -t latex -V geometry=margin=2.5cm \
+  -V classoption=12pt,a4paper -V links-as-notes \
+  -V header-includes=\\usepackage{nopageno}
+
+
+%.pdf: %.mdwn
+       cat $< |\
+       sed -f sed/latex.sed |\
+       pandoc $(OPTS) -o $@
+
+clean:
+       rm -f $(ALL)
+
+.PHONO: all clean
diff --git a/cash/sed/latex.sed b/cash/sed/latex.sed
new file mode 100644 (file)
index 0000000..4bb2137
--- /dev/null
@@ -0,0 +1,9 @@
+1,/^$/ {
+  1 i ---
+  /^$/ i ...
+  s/^\[\[.*meta \(.*\)="\(.*\)".*$/\1: \2/
+  /^title: / {
+      s/ -- /\\linebreak /
+  }
+}
+