Skip to content

Commit 2ed3431

Browse files
committed
Fix global variables showing modules and will now list values
1 parent af331f7 commit 2ed3431

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lazydocs/generation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,11 @@ def module2md(self, module: types.ModuleType, depth: int = 1, is_mdx: bool = Fal
10231023
continue
10241024
if hasattr(obj, "__name__") and not obj.__name__.startswith(modname):
10251025
continue
1026+
if isinstance(obj, types.ModuleType):
1027+
continue
10261028
comments = inspect.getcomments(obj)
1027-
comments = ": %s" % comments if comments else ""
1028-
variables.append("- **%s**%s" % (name, comments))
1029+
comments = " \n\t*%s*" % comments if comments else ""
1030+
variables.append("- **%s** = %s%s" % (name, obj, comments))
10291031
line_nos.append(_get_line_no(obj) or 0)
10301032

10311033
variables = _order_by_line_nos(variables, line_nos)

0 commit comments

Comments
 (0)