aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-21 13:52:18 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-21 13:52:18 +0200
commit22e26f2691a6296e4c6b0a960c5d15807bab2ed1 (patch)
treef23f007498538cce7b70451a656da77905417732
downloadpv-22e26f2691a6296e4c6b0a960c5d15807bab2ed1.tar.gz
First commit
-rw-r--r--.gitignore3
-rw-r--r--Makefile16
-rwxr-xr-xembed15
3 files changed, 34 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..53ed342
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.html
+*.svg
+*.pdf
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4ea2581
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,16 @@
+HOST = root@ankarstrom.se
+DIR = /var/www/git/htdocs/preview
+DEST = $(HOST):$(DIR)
+
+SET = ssh root@ankarstrom.se /git/set readme $(DIR)
+IGN = 2>/dev/null || true
+
+upload: fref.html
+ rsync fref* $(DEST)
+ $(SET)/fref.html /git/fref
+
+fref.html: ../fref/fref.pdf
+ @rm fref*.svg $(IGN)
+ cp ../fref/fref.pdf .
+ mutool convert -o fref.svg fref.pdf
+ ./embed fref > fref.html
diff --git a/embed b/embed
new file mode 100755
index 0000000..6561ccf
--- /dev/null
+++ b/embed
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+
+: ${WWW:=http://git.ankarstrom.se/preview}
+
+cat <<HTML
+<div style='width: 100%; background: #ddd;'>
+<div style='padding: 10px; text-align: center;'>
+Preview of <a href='$WWW/$1.pdf'>$1.pdf</a>
+</div>
+</div>
+HTML
+
+for f in "$1"*.svg; do
+ echo "<embed src='$WWW/$f' type='image/svg+xml' width='100%'/>"
+done