from rich.markdown import Markdown from textual import events from textual.app import App from textual.widgets.header import Header from textual.widgets.placeholder import Placeholder from textual.widgets.scroll_view import ScrollView with open("richreadme.md", "rt") as fh: readme = Markdown(fh.read(), hyperlinks=True, code_theme="fruity") class MyApp(App): KEYS = {"q": "quit", "ctrl+c": "quit", "b": "view.toggle('left')"} async def on_startup(self, event: events.Startup) -> None: await self.view.mount_all( header=Header(self.title), left=Placeholder(), body=ScrollView(readme) ) app = MyApp() app.run()