]> apps.delaporte.us Git - minion.git/commitdiff
Add minion print to pdf
authorEdward Delaporte <edward@delaporte.us>
Sun, 2 Aug 2026 21:18:56 +0000 (16:18 -0500)
committerEdward Delaporte <edward@delaporte.us>
Sun, 2 Aug 2026 21:18:56 +0000 (16:18 -0500)
bin/mpp [new file with mode: 0755]
example.css [new file with mode: 0644]

diff --git a/bin/mpp b/bin/mpp
new file mode 100755 (executable)
index 0000000..7cb370b
--- /dev/null
+++ b/bin/mpp
@@ -0,0 +1,27 @@
+#!/bin/bash
+# mpp - minion print to PDF
+# Like `ml / minion list`, but gets the markdown file ready to print
+# Will act on a maximum of four files.
+# Requires ~/Journal/journal.css for styling.
+# Creates .md.pdf files.
+year=`date +%Y`
+files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md")
+
+JOURNAL_CSS=$HOME/Journal/journal.css
+if [ ! -f $JOURNAL_CSS ]; then
+  echo "Please create a CSS file at $JOURNAL_CSS and retry."
+  exit 1
+fi
+
+counter=0
+for file in $files; do 
+       # echo $file
+  md2pdf -i $file -o $file.pdf -c $JOURNAL_CSS
+       counter=$((counter + 1))
+if [ $counter -gt 4 ]; then
+               echo "Aborting after 4 files."
+               echo "The following files would have been processed..."
+               echo $files
+               exit 1
+fi
+done
diff --git a/example.css b/example.css
new file mode 100644 (file)
index 0000000..579d330
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+Check these with the color contrast checker:
+https://www.accessibilitychecker.org/color-contrast-checker/
+*/
+
+body
+{
+       /* font-family: 'times new roman', times, serif; */
+  font-family: monospace;
+       font-size:1.8vmax;
+  margin: 1vmax;
+}
+
+table, th, td {
+  border: 1px solid;
+  border-collapse: collapse;
+}
+
+th, td {
+  padding: .5em;
+}
+
+h1 {
+       font-size: 3vmax;
+       font-weight: 400;
+       letter-spacing: 3px;
+}
+
+h2 {
+       padding-left: 1vmax;
+  font-family: monospace;
+       font-size:2.5vmax;
+}
+
+h3, h4 {
+       padding-left: 1vmax;
+       font-size:2.4vmax;
+}
+
+img {
+    max-width: 300px;
+    box-shadow: 0.2em 0.2em #757575d2
+}
+
+/* Code Block Defaults */
+
+pre {
+    font-size: 2.2vmax;
+    background-color: var(--code-bg-color);
+}
+code {
+    font-size: 2.2vmax;
+    background-color: var(--code-bg-color);
+}
+
+.content {
+  align-content: center;
+       margin: 1vmax;
+  margin-left: 1vmax;
+  margin-right: 1vmax;
+  max-width: 95%;
+}
+
+/* Make quotes stand out a bit more */
+blockquote {
+  border-style: outset;
+  padding: 1vmax;
+}