mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Allow the markdown example to be run outside of examples directory
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from textual.app import App, ComposeResult
|
from textual.app import App, ComposeResult
|
||||||
from textual.reactive import var
|
from textual.reactive import var
|
||||||
from textual.widgets import Footer, MarkdownViewer
|
from textual.widgets import Footer, MarkdownViewer
|
||||||
@@ -10,7 +12,7 @@ class MarkdownApp(App):
|
|||||||
("f", "forward", "Forward"),
|
("f", "forward", "Forward"),
|
||||||
]
|
]
|
||||||
|
|
||||||
path = var("demo.md")
|
path = var(str(Path(__file__).parent / "demo.md"))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def markdown_viewer(self) -> MarkdownViewer:
|
def markdown_viewer(self) -> MarkdownViewer:
|
||||||
|
|||||||
Reference in New Issue
Block a user