scripts for my gemini capsule
Diffstat (limited to 'webp.py')
| -rwxr-xr-x | webp.py | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -19,18 +19,23 @@ def main(qs): if not qs: print("10 Enter a scripture reference\r\n") return - books=subprocess.check_output([f"find", "webp/", "-name", f'??-*.usfm']).strip().split(b"\n") - books.sort() passages = parse_string(qs) # TODO: Also handle "john 3, tomato 2" errors? if type(passages[0]) == tuple: print("51 " + str(passages[0][0]) + "'\r\n") return print("20 text/gemini\r\n") - print('=>https://ebible.org/find/details.php?id=engwebp&all=1 This content from World English Bible (public domain)') - print('=> gemini://gemini.zachdecook.com/usfm2gmi/ and rendered with usfm2gmi') + printwebp(passages) + +def printwebp(passages, title=True, plug=True): + books=subprocess.check_output([f"find", "webp/", "-name", f'??-*.usfm']).strip().split(b"\n") + books.sort() + if plug: + print('=>https://ebible.org/find/details.php?id=engwebp&all=1 This content from World English Bible (public domain)') + print('=> gemini://gemini.zachdecook.com/usfm2gmi/ and rendered with usfm2gmi') for passage in passages: - print("# " + passage.format()) + if title: + print("# " + passage.format()) printing = 0 inendc = False bookn = passage.start.book |