Skip to content

Commit 14c9c47

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 f33d1c4 commit 14c9c47

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
@@ -25,6 +25,7 @@
2525
EditModeView,
2626
FullRenderedMsgView,
2727
HelpView,
28+
MarkdownHelpView,
2829
MsgInfoView,
2930
NoticeView,
3031
PopUpConfirmationView,
@@ -240,6 +241,12 @@ def show_help(self) -> None:
240241
help_view = HelpView(self, "Help Menu (up/down scrolls)")
241242
self.show_pop_up(help_view, "area:help")
242243

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

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)