about summary refs log tree commit diff
path: root/usfm2gmi.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-07-08 21:29:07 -0400
committerZach DeCook <zachdecook@librem.one>2021-07-08 21:29:07 -0400
commit04f01be7227cea94418b0c96292ba35d34d97fd0 (patch)
treec41f6764d089d68ada6013c91e0cb2ccb01efeda /usfm2gmi.py
parent4b03a402048dd02b8da1a0d811c126904d11f0bf (diff)
downloadusfm2gmi-04f01be7227cea94418b0c96292ba35d34d97fd0.tar.gz
cross references: Put in parentheses
Diffstat (limited to 'usfm2gmi.py')
-rwxr-xr-xusfm2gmi.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/usfm2gmi.py b/usfm2gmi.py
index 7bfef3b..65a0f95 100755
--- a/usfm2gmi.py
+++ b/usfm2gmi.py
@@ -91,6 +91,16 @@ def convert(line):
       skip = 1 # verse reference not necessary for inline fn
     elif word == '\\f*':
       out += ']'
+    # Cross-references (https://ubsicap.github.io/usfm/notes_basic/xrefs.html)
+    elif word == '\\x':
+      out += '('
+      skip = 1 # next character is xref caller
+    elif word == '\\xo':
+      skip = 1 # verse reference not necessary for inline xref
+    elif word in ['\\xt']:
+      continue
+    elif word == '\\x*':
+      out += ')'
     # TODO: support Endnotes (\fe and \fe*)
     elif word in ['\\ft']:
       continue # TODO: fancy formatting of more types