Skip to content

Commit 31c3985

Browse files
committed
Parse individual arguments
1 parent 9475e52 commit 31c3985

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docstring_to_markdown/google.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,23 @@ def _parse(self, content: str) -> None:
5252

5353
# Format section
5454
for part in parts:
55-
self.content += "- {}\n".format(part[0])
55+
if ":" in part[0]:
56+
spl = part[0].split(":")
57+
58+
arg = spl[0]
59+
description = ":".join(spl[1:])
60+
61+
self.content += "- `{}`: {}\n".format(arg, description)
62+
else:
63+
self.content += "- {}\n".format(part[0])
5664

5765
for line in part[1:]:
5866
self.content += " {}\n".format(line)
5967

6068
self.content = self.content.rstrip("\n")
6169

6270
def as_markdown(self) -> str:
63-
return "# {}\n\n{}\n\n".format(self.name, self.content)
71+
return "#### {}\n\n{}\n\n".format(self.name, self.content)
6472

6573
def __repr__(self) -> str:
6674
return "Section(name={}, content={})".format(self.name, self.content)

0 commit comments

Comments
 (0)