Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/apiage: Provide links to go docs for APIs #734

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions contrib/apiage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(" | ")
Expand All @@ -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")

Expand Down