From dfce639aae0f9cdc8fe203eb73ab8ab9b421d678 Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 28 Jul 2024 03:15:00 -0400 Subject: [PATCH] plan --- README.md | 13 +++++++++++++ src/wud/tui.py | 17 +---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d4a53de..1bffab8 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ # wud: what's up doc + +## Tasks + +- TODO: add key navigation + - [ ] arrow keys/hjkl + - [ ] / search + - [ ] m new module prompt +- IDEA: pluggable parsers for other languages +- TODO: classes + - [ ] constructor + - [ ] methods + - [ ] attributes +- DONE: basic browser of docstrings diff --git a/src/wud/tui.py b/src/wud/tui.py index b0443d5..4d40593 100644 --- a/src/wud/tui.py +++ b/src/wud/tui.py @@ -20,21 +20,6 @@ class MemberListView(ListView): yield ListItem(Label(f"{f.name:<16}{f.icon}")) -def func2md(func): - return f"""## {func.name}{func.signature} - {func.desc} - """ - - -def mod2md(mod): - func_md = "\n\n".join(func2md(f) for f in mod.functions) - return f"""# {mod.name} - {mod.desc} - - {func_md} - """ - - # class DocView(MarkdownViewer): # # def __init__(self, mod): @@ -59,7 +44,7 @@ class WudTui(App): def compose(self) -> ComposeResult: yield Header() yield MemberListView(self.mod_list) - yield Markdown(mod2md(self.mod), id="docview") + yield Markdown(self.mod_list[0].as_markdown(), id="docview") def on_mount(self): self.title = "wud"