Convert usfm bibles into gemtext (python library/utility)
titles: also convert remaining text
Zach DeCook 2021-02-25
parent f3af18d · commit 5efacd0
-rwxr-xr-xusfm2gmi.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/usfm2gmi.py b/usfm2gmi.py
index 516e72c..2f0f376 100755
--- a/usfm2gmi.py
+++ b/usfm2gmi.py
@@ -24,12 +24,12 @@ def convert(line):
if len(split) == 0:
return out
elif split[0] in ['\\mt1','\\mt','\\ms','\\h']:
- return '\n# ' + ' '.join(split[1:])
+ return '\n# ' + convert(' '.join(split[1:]))
# TODO: parse as word for title tags in title line
elif split[0] in ['\\mt2','\\s']:
- return '\n## ' + ' '.join(split[1:])
+ return '\n## ' + convert(' '.join(split[1:]))
elif split[0] in ['\\mt3','\\d']:
- return '\n### ' + ' '.join(split[1:])
+ return '\n### ' + convert(' '.join(split[1:]))
elif split[0] == '\\b':
return '\n'
elif split[0] == '\\rem':