Skip to content

Commit b234195

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 4becaa1 commit b234195

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

zulipterminal/core.py

+8
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,13 @@ 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) -> None:
225+
markdown_view = MarkdownHelpView(
226+
self, "Markdown Help Menu (up/down scrolls)",
227+
self.model.server_url
228+
)
229+
self.show_pop_up(markdown_view, 'area:help')
230+
223231
def show_topic_edit_mode(self, button: Any) -> None:
224232
self.show_pop_up(EditModeView(self, button), 'area:msg')
225233

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