diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-08-12 14:12:58 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-08-12 14:36:36 +0200 |
| commit | f367d40f7c2767d4c7416ec47d1b9ba924b39a9a (patch) | |
| tree | 51fb2426331765d4a0529693f581ea2160d5c902 /genexportsdoc.py | |
| parent | 1cf11a26eaaef7619ce4714f63384157530412dc (diff) | |
genexports: Fix Register signature
Register is multi-line
Diffstat (limited to 'genexportsdoc.py')
| -rwxr-xr-x | genexportsdoc.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/genexportsdoc.py b/genexportsdoc.py index dc32182..73d9da1 100755 --- a/genexportsdoc.py +++ b/genexportsdoc.py @@ -47,7 +47,17 @@ for sec in section: first = False continue lines = sec.splitlines() - signature, doc = lines[0], "\n".join(lines[1:]) + + # parse multi-line function names + # detect end of line if we get a ) + # hacky but works for our use case + signature_len = 1 + for line in lines: + if not ")" in line: + signature_len += 1 + else: + break + signature, doc = "\n".join(lines[:signature_len]), "\n".join(lines[signature_len:]) body = f"Signature:\n ```go\n{signature}\n```\n{doc}" gen_sections.append((func_name(signature), body)) |
