scripts for my gemini capsule
oeb and lsv: newline changes, use in makeplan
| -rwxr-xr-x | lsv.py | 4 | ||||
| -rw-r--r-- | makeplan.sh | 4 | ||||
| -rwxr-xr-x | oeb.sh | 4 |
3 files changed, 8 insertions, 4 deletions
@@ -5,12 +5,12 @@ import os import sys def printf(line): - if line: + if line.strip(): notref = ' '.join(line.split(' ')[2:]).strip() notref = notref.replace('||', "\n") print(notref, end=' ') else: - print('') + print() def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) diff --git a/makeplan.sh b/makeplan.sh index 942c550..2a02d03 100644 --- a/makeplan.sh +++ b/makeplan.sh @@ -8,13 +8,13 @@ ps="$(grep "^$day" "$1" | cut -f4)" pr="$(grep "^$day" "$1" | cut -f5)" echo "# Old Testament Reading" -gmni "gemini://gemini.zachdecook.com/cgi-bin/net.sh?$ot" +gmni "gemini://gemini.zachdecook.com/cgi-bin/lsv.py?$ot" echo "# New Testament Reading" gmni "gemini://gemini.zachdecook.com/cgi-bin/net.sh?$nt" echo "# Psalm" -gmni "gemini://gemini.zachdecook.com/cgi-bin/net.sh?$ps" +gmni "gemini://gemini.zachdecook.com/cgi-bin/oeb.sh?$ps" echo "# Proverb" gmni "gemini://gemini.zachdecook.com/cgi-bin/net.sh?$pr" @@ -22,7 +22,11 @@ if ! test "$file"; then return 1 fi printf "20 text/gemini\r\n" +echo '=> https://github.com/openenglishbible/Open-English-Bible This content from OpenEnglishBible (public domain)' +echo '=> gemini://gemini.zachdecook.com/usfm2gmi/ and rendered with usfm2gmi' echo "# $book $chstart:$vstart - $chend:$vend" grep '\c '"$chstart$" $file -A5000 | grep '\v '"$vstart " -A5000 \ | tac|grep '\c '$(($chend + 1))'$' -A5000 | grep '\v '$vend' ' -A5000 | tac\ | usfm2gmi/usfm2gmi.py +# end in newline +echo '' |