Allow the markdown example to be run outside of examples directory

This commit is contained in:
Dave Pearson
2023-02-15 09:43:21 +00:00
parent 6cdb950a49
commit 013f6cbc3f

View File

@@ -1,3 +1,5 @@
from pathlib import Path
from textual.app import App, ComposeResult
from textual.reactive import var
from textual.widgets import Footer, MarkdownViewer
@@ -10,7 +12,7 @@ class MarkdownApp(App):
("f", "forward", "Forward"),
]
path = var("demo.md")
path = var(str(Path(__file__).parent / "demo.md"))
@property
def markdown_viewer(self) -> MarkdownViewer: