Broken project to implement a cross-protocol browser in textual
Diffstat (limited to 'browset.py')
-rw-r--r--browset.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/browset.py b/browset.py
index a396768..7ea57c6 100644
--- a/browset.py
+++ b/browset.py
@@ -1,9 +1,9 @@
from textual.app import App, ComposeResult
-from textual.widgets import Input, Button, Static
+from textual.widgets import Input, Button, Static, Footer
from textual.containers import Container
from rich.markdown import Markdown
from textual.binding import Binding
-
+from gemtext import Gemtext
class Browset(App):
CSS_PATH = "browset.css"
@@ -11,8 +11,9 @@ class Browset(App):
Binding("ctrl+c,ctrl+q", "app.quit", "Quit", show=True),
]
- content = "## Hello\n* Bullet points\n*OH Yeah!"
+ content = "## Hello\n* Bullet points\n*OH Yeah!\n=>URI some link"
def compose(self) -> ComposeResult:
+ yield Footer()
yield Container(
Button("🔙"), # ⏪
Button("🔝"), # ⏫
@@ -22,10 +23,10 @@ class Browset(App):
Input(placeholder="Enter URI"),
id="toolbar"
)
- yield Static(Markdown(self.content), id="content")
+ yield Gemtext(txt=self.content, id="content")
async def on_input_submitted(self, message: Input.Submitted) -> None:
self.content = "## new stuff\n"+message.value
- self.query_one("#content", Static).update(Markdown(self.content))
+ self.query_one("#content", Gemtext).update(self.content)
if __name__ == "__main__":
app = Browset()