diff options
| author | Paul Buetow <paul@buetow.org> | 2025-10-17 20:28:07 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-10-17 20:28:07 +0300 |
| commit | 3d8d9ae9332339a401cd5c1469c75ed4896b817e (patch) | |
| tree | 5bc30700c5b51bf571d12da08410056333ad11f8 /gemfeed/convert-notes-to-pdfs.sh | |
| parent | e38266506dda5ce4019b01eda46497df58276111 (diff) | |
Update content for gemtext
Diffstat (limited to 'gemfeed/convert-notes-to-pdfs.sh')
| -rwxr-xr-x | gemfeed/convert-notes-to-pdfs.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gemfeed/convert-notes-to-pdfs.sh b/gemfeed/convert-notes-to-pdfs.sh new file mode 100755 index 00000000..9b5a6708 --- /dev/null +++ b/gemfeed/convert-notes-to-pdfs.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +convert () { + find . -name \*.note \ + | while read -r note; do + echo supernote-tool convert -a -t pdf "$note" "${note/.note/.pdf}" + supernote-tool convert -a -t pdf "$note" "${note/.note/.pdf}.tmp" + mv "${note/.note/.pdf}.tmp" "${note/.note/.pdf}" + du -hs "$note" "${note/.note/.pdf}" + echo + done +} + +# Mage the PDFs available on my Phone as well +copy () { + if [ ! -d ~/Documents/Supernote ]; then + echo "Directory ~/Documents/Supernote does not exist, skipping" + exit 1 + fi + + rsync -delete -av --include='*/' --include='*.pdf' --exclude='*' . ~/Documents/Supernote/ + echo This was copied from $(pwd) so dont edit manually >~/Documents/Supernote/README.txt +} + +convert +copy |
