From: Luke Kenneth Casson Leighton Date: Sun, 9 Apr 2023 10:25:03 +0000 (+0100) Subject: provide linking to pages/rfcs for ls012 X-Git-Tag: opf_rfc_ls012_v1~49 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=133cb4b0ee6701911a9109f02370e9b4e677d48e;p=libreriscv.git provide linking to pages/rfcs for ls012 --- 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")