Skip to content

Commit 4abad33

Browse files
committed
core/ui: Add UI elements to markdown help view on toggling.
This commit adds: * member function show_markdown_help() to trigger the popup. * keypress event in `ui.py` to trigger the popup. Fixes zulip#623.
1 parent 146d5bf commit 4abad33

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

zulipterminal/core.py

+7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
EditHistoryView,
2525
EditModeView,
2626
HelpView,
27+
MarkdownHelpView,
2728
MsgInfoView,
2829
NoticeView,
2930
PopUpConfirmationView,
@@ -239,6 +240,12 @@ def show_help(self) -> None:
239240
help_view = HelpView(self, "Help Menu (up/down scrolls)")
240241
self.show_pop_up(help_view, "area:help")
241242

243+
def show_markdown_help(self) -> None:
244+
markdown_view = MarkdownHelpView(
245+
self, "Markdown Help Menu (up/down scrolls)", self.model.server_url
246+
)
247+
self.show_pop_up(markdown_view, "area:help")
248+
242249
def show_topic_edit_mode(self, button: Any) -> None:
243250
self.show_pop_up(EditModeView(self, button), "area:msg")
244251

zulipterminal/ui.py

+4
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ def keypress(self, size: urwid_Box, key: str) -> Optional[str]:
274274
# Show help menu
275275
self.controller.show_help()
276276
return key
277+
elif is_command_key("MARKDOWN_HELP", key):
278+
# Show markdown help menu
279+
self.controller.show_markdown_help()
280+
return key
277281
# replace alternate keys with arrow/functional keys
278282
# This is needed for navigating in widgets
279283
# other than message_view.

0 commit comments

Comments
 (0)