image display basic functionality
This commit is contained in:
@@ -7,6 +7,7 @@ from textual.containers import Vertical, Horizontal, ScrollableContainer
|
||||
from textual import work
|
||||
from textual.worker import Worker
|
||||
from apis.himalaya import client as himalaya_client
|
||||
from markitdown import MarkItDown
|
||||
|
||||
class EnvelopeHeader(Vertical):
|
||||
def __init__(self, **kwargs):
|
||||
@@ -53,10 +54,11 @@ class ContentContainer(ScrollableContainer):
|
||||
can_focus = True
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.md = MarkItDown()
|
||||
# self.header = EnvelopeHeader(id="envelope_header")
|
||||
self.content = Markdown("", id="markdown_content")
|
||||
self.html_content = Static("", id="html_content", markup=False)
|
||||
self.current_mode = "html" # Default to HTML mode
|
||||
self.current_mode = "text" # Default to text mode
|
||||
self.current_content = None
|
||||
self.current_message_id = None
|
||||
self.content_worker = None
|
||||
@@ -97,7 +99,7 @@ class ContentContainer(ScrollableContainer):
|
||||
self.notify("No message ID provided.")
|
||||
return
|
||||
|
||||
content, success = await himalaya_client.get_message_content(message_id, format)
|
||||
content, success = await himalaya_client.get_message_content(message_id)
|
||||
if success:
|
||||
self._update_content(content)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user