From 13950f01d763500a295d2c46d128a514537cd0ed Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Fri, 8 Jul 2022 16:51:54 +0530 Subject: [PATCH] contrib/apiage: Provide links to go docs for APIs Signed-off-by: Anoop C S --- contrib/apiage.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/contrib/apiage.py b/contrib/apiage.py index 6a9930b10..5cc5604a3 100755 --- a/contrib/apiage.py +++ b/contrib/apiage.py @@ -149,6 +149,7 @@ def format_markdown(tracked, outfh): ("Added in Version", "added_in_version"), ("Expected Stable Version", "expected_stable_version"), ], + pkg=pkg, outfh=outfh, ) print("", file=outfh) @@ -162,12 +163,13 @@ def format_markdown(tracked, outfh): ("Deprecated in Version", "deprecated_in_version"), ("Expected Removal Version", "expected_remove_version"), ], + pkg=pkg, outfh=outfh, ) print("", file=outfh) -def _table(data, columns, outfh): +def _table(data, columns, pkg, outfh): for key, _ in columns: outfh.write(key) outfh.write(" | ") @@ -178,7 +180,10 @@ def _table(data, columns, outfh): outfh.write("\n") for entry in data: for _, dname in columns: - outfh.write(entry[dname]) + if dname == "name": + outfh.write(f"[{entry[dname]}](https://pkg.go.dev/github.com/ceph/go-ceph/{pkg}#{entry[dname]})") + else: + outfh.write(entry[dname]) outfh.write(" | ") outfh.write("\n")