mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
No, I repeat, no abbreviations
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
Welcome fellow adventurer! If you ran `markdown.py` from the terminal you are viewing `demo.md` with Textual's built in Markdown widget.
|
||||
|
||||
The widget supports much of the Markdown spec. THere is also an optional Table of Contents sidebar which you will see to your left.
|
||||
The widget supports much of the Markdown spec. There is also an optional Table of Contents sidebar which you will see to your left.
|
||||
|
||||
## Do You Want to Know More?
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from textual.widgets import Footer, MarkdownViewer
|
||||
|
||||
class MarkdownApp(App):
|
||||
BINDINGS = [
|
||||
("t", "toggle_toc", "TOC"),
|
||||
("t", "toggle_table_of_contents", "TOC"),
|
||||
("b", "back", "Back"),
|
||||
("f", "forward", "Forward"),
|
||||
]
|
||||
@@ -26,8 +26,10 @@ class MarkdownApp(App):
|
||||
if not await self.markdown_viewer.go(self.path):
|
||||
self.exit(message=f"Unable to load {self.path!r}")
|
||||
|
||||
def action_toggle_toc(self) -> None:
|
||||
self.markdown_viewer.show_toc = not self.markdown_viewer.show_toc
|
||||
def action_toggle_table_of_contents(self) -> None:
|
||||
self.markdown_viewer.show_table_of_contents = (
|
||||
not self.markdown_viewer.show_table_of_contents
|
||||
)
|
||||
|
||||
async def action_back(self) -> None:
|
||||
await self.markdown_viewer.back()
|
||||
|
||||
Reference in New Issue
Block a user