Skip to content

Commit eeebda7

Browse files
committed
core: 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 5548863 commit eeebda7

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
@@ -23,6 +23,7 @@
2323
EditHistoryView,
2424
EditModeView,
2525
HelpView,
26+
MarkdownHelpView,
2627
MsgInfoView,
2728
NoticeView,
2829
PopUpConfirmationView,
@@ -220,6 +221,12 @@ def show_help(self) -> None:
220221
help_view = HelpView(self, "Help Menu (up/down scrolls)")
221222
self.show_pop_up(help_view, 'area:help')
222223

224+
def show_markdown_help(self, server_url: str) -> None:
225+
markdown_view = MarkdownHelpView(
226+
self, "Markdown Help Menu (up/down scrolls)", server_url
227+
)
228+
self.show_pop_up(markdown_view, 'area:help')
229+
223230
def show_topic_edit_mode(self, button: Any) -> None:
224231
self.show_pop_up(EditModeView(self, button), 'area:msg')
225232

zulipterminal/ui.py

+4
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ def keypress(self, size: Tuple[int, int], key: str) -> Optional[str]:
259259
# Show help menu
260260
self.controller.show_help()
261261
return key
262+
elif is_command_key('MARKDOWN_HELP', key):
263+
# Show markdown help menu
264+
self.controller.show_markdown_help(self.model.server_url)
265+
return key
262266
# replace alternate keys with arrow/functional keys
263267
# This is needed for navigating in widgets
264268
# other than message_view.

0 commit comments

Comments
 (0)