Skip to content

Commit c4aa3c6

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 4ec697a commit c4aa3c6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

zulipterminal/core.py

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
FullRawMsgView,
2727
FullRenderedMsgView,
2828
HelpView,
29+
MarkdownHelpView,
2930
MsgInfoView,
3031
NoticeView,
3132
PopUpConfirmationView,
@@ -241,6 +242,12 @@ def show_help(self) -> None:
241242
help_view = HelpView(self, "Help Menu (up/down scrolls)")
242243
self.show_pop_up(help_view, "area:help")
243244

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

zulipterminal/ui.py

+3
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ 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+
self.controller.show_markdown_help()
279+
return key
277280
# replace alternate keys with arrow/functional keys
278281
# This is needed for navigating in widgets
279282
# other than message_view.

0 commit comments

Comments
 (0)