No, I repeat, no abbreviations

This commit is contained in:
Will McGugan
2023-02-14 17:28:24 +00:00
parent 5a730d7a0a
commit 08c3a7214e
8 changed files with 133 additions and 189 deletions

View File

@@ -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?

View File

@@ -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()