diff options
Diffstat (limited to 'genexportsdoc.py')
| -rwxr-xr-x | genexportsdoc.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/genexportsdoc.py b/genexportsdoc.py index ed538b2..dc32182 100755 --- a/genexportsdoc.py +++ b/genexportsdoc.py @@ -2,9 +2,9 @@ import subprocess -cmd=["go", "doc", "--all", "exports"] +cmd = ["go", "doc", "--all", "exports"] -output=subprocess.check_output(cmd).decode("utf-8") +output = subprocess.check_output(cmd).decode("utf-8") section = [""] package_doc = "" @@ -26,14 +26,17 @@ for out in output.splitlines(): if in_section: section[num] += line + def func_name(signature: str) -> str: idx = signature.index("(") - return signature[len("func "):idx] + return signature[len("func ") : idx] + def gen_toc(title: str) -> str: id = "-".join(title.lower().split(" ")) return f"[{title}](#{id})" + toc = "" first = True |
