Convert usfm bibles into gemtext (python library/utility)
mt: rough implementation
Zach DeCook 2021-02-25
parent 5f57484 · commit 9cd73b7
-rwxr-xr-xusfm2gmi.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/usfm2gmi.py b/usfm2gmi.py
index 7cc2f24..2d27827 100755
--- a/usfm2gmi.py
+++ b/usfm2gmi.py
@@ -10,8 +10,13 @@ def convert(line):
out = ''
if len(split) == 0:
return out
- elif split[0] == '\\s':
+ elif split[0] in ['\\mt1','\\mt','\\ms']:
+ return '\n# ' + ' '.join(split[1:])
+ # TODO: parse as word for title tags in title line
+ elif split[0] in ['\\mt2','\\s']:
return '\n## ' + ' '.join(split[1:])
+ elif split[0] in ['\\mt3']:
+ return '\n### ' + ' '.join(split[1:])
elif split[0] == '\\b':
return '\n'
elif split[0] == '\\rem':