From 133cb4b0ee6701911a9109f02370e9b4e677d48e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 9 Apr 2023 11:25:03 +0100 Subject: [PATCH] provide linking to pages/rfcs for ls012 --- openpower/sv/rfc/ls012_optable.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/openpower/sv/rfc/ls012_optable.py b/openpower/sv/rfc/ls012_optable.py index 846819ed0..22822f8b3 100644 --- a/openpower/sv/rfc/ls012_optable.py +++ b/openpower/sv/rfc/ls012_optable.py @@ -125,10 +125,21 @@ def print_table(title, header, areas, sortby): for row in rows: # adjust row (add same spaces as header width) r = [] - for (value, col_len) in zip(row.values(), cols.values()): - value = value.replace("_", "\_") # latex, duh - n_spaces = col_len - len(value) - r.append(value + " " * n_spaces) + for key in row.keys(): + col_len, value = cols[key], row[key] + if key == 'page': + prefix = 'https://libre-soc.org/openpower/' + v = value.replace("_", "\_") # latex, duh + url = '[%s](%s%s)' % (value, prefix, v) + r.append(url) + elif key == 'rfc' and value.startswith('ls'): + prefix = 'https://libre-soc.org/openpower/sv/rfc/' + url = '[%s](%s%s)' % (value, prefix, value) + r.append(url) + else: + value = value.replace("_", "\_") # latex, duh + n_spaces = col_len - len(value) + r.append(value + " " * n_spaces) # write row write_mdwn_row(f, r) f.write("\n\n") -- 2.30.2