about summary refs log tree commit diff
path: root/asv.py
diff options
context:
space:
mode:
Diffstat (limited to 'asv.py')
-rwxr-xr-xasv.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/asv.py b/asv.py
index 8014a8d..2f82304 100755
--- a/asv.py
+++ b/asv.py
@@ -17,11 +17,20 @@ def main(qs):
     bookNum=passage.start.book
     fname=sco(['find', 'asv/', '-name', f'{bookNum}*']).strip()
     root = ET.parse(fname).getroot()
+    printing = 0
+    endc = False
     for thing in list(root):
+      if thing.tag == 'chapter':
+        if int(thing.attrib['number']) == int(passage.start.chapter):
+          printing = 1
+        if int(thing.attrib['number']) == int(passage.end.chapter):
+          endc = True
+        if int(thing.attrib['number']) > int(passage.end.chapter):
+          printing = 0
+      if printing >= 1:
         printf(convertBlock(thing))
     
     
-    printing = 0
 #    for line in open("asv.xml.gmi"):
 #      if line == '### ' + passage.start.format().split(':')[0]:
 #        printing = 1