add extra lookup for SV
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 30 Jun 2022 18:43:10 +0000 (19:43 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 30 Jun 2022 18:43:10 +0000 (19:43 +0100)
openpower/pandoc_img.py

index 63895462738144ac4c089b09eecd0394c070a7bd..2569d0a526b2ee7e0a6a621e9b19d330bd8ea8c8 100755 (executable)
@@ -48,13 +48,9 @@ def inlinenotes(k, v, f, meta):
         # link page
         if v.startswith("[[") and v.endswith("]]"):
             link = v[2:-2]
-            if '|' in link:
-                link, ref = link.split("|")
-                return Link(['', [], []],
-                            [Str(link)],
-                            [ref, ''])
             out.write("     link %s\n" % link)
-            lookups = {'sv': 'Scalable Vectors for the Power ISA',
+            lookups = {'sv': 'Scalable Vectors for Power ISA',
+                       'SV|sv': 'Scalable Vectors for Power ISA',
                        'sv/overview': 'Overview Chapter',
                        'sv/compliancy_levels': 'Compliancy Levels',
                        'sv/svp64': 'SVP64 Chapter',
@@ -78,6 +74,11 @@ def inlinenotes(k, v, f, meta):
                 return Link(['', [], []],
                             [Str(lookups[link])],
                             ['#%s' % link, ''])
+            if '|' in link:
+                link, ref = link.split("|")
+                return Link(['', [], []],
+                            [Str(link)],
+                            [ref, ''])
     if k == 'Link':
         out.write("     link type %s\n" % \
             (type(v[1][0])))