Convert usfm bibles into gemtext (python library/utility)
mt: rough implementation
| -rwxr-xr-x | usfm2gmi.py | 7 |
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': |