From d1ef36351d4ca043c60dc13f7435d922d8c04389 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Sun, 3 Mar 2019 13:49:21 -0500 Subject: [PATCH] Updated the inline help page to match CONTROLS.md --- CHANGELOG.rst | 3 +- CONTROLS.md | 30 ++++++------ rtv/docs.py | 131 +++++++++++++++++++++++++++++--------------------- 3 files changed, 93 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ab264a8..e14d53f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -50,6 +50,7 @@ Features message chains and replying to messages, marking messages as read/unread, and opening the context of a comment. * Added the ability to compose new private messages with the ``C`` key. +* Updated and enhanced the help ``?`` page. Bugfixes @@ -60,7 +61,7 @@ Bugfixes Configuration Changes -* Renamed the following keybindings to be more generic: +* Renamed the following keybindings to better represent their usage: * ``SORT_HOT`` -> ``SORT_1`` * ``SORT_TOP`` -> ``SORT_2`` diff --git a/CONTROLS.md b/CONTROLS.md index 8557e46..57b0038 100644 --- a/CONTROLS.md +++ b/CONTROLS.md @@ -26,13 +26,13 @@ The / key opens a text prompt at the bottom of the screen. You can us this to type in the name of the subreddit that you want to open. The following text formats are recognized: -- ``python`` - Open a subreddit, shorthand +- ``/python`` - Open a subreddit, shorthand - ``/r/python`` - Open a subreddit - ``/r/python/new`` - Open a subreddit, sorted by category -- ``/r/python/controversial-year`` - Open a subreddit, sorted by category and time period +- ``/r/python/controversial-year`` - Open a subreddit, sorted by category and time - ``/r/python+linux+commandline`` - Open multiple subreddits merged together -- ``/r/python/comments/30rwj2`` - Open the comments page for a submission -- ``/comments/30rwj2`` - Open the comments page for a submission, shorthand +- ``/comments/30rwj2`` - Open a submission, shorthand +- ``/r/python/comments/30rwj2`` - Open a submission - ``/r/front`` - Open your front page - ``/u/me`` - View your submissions - ``/u/me/saved`` - View your saved content @@ -48,8 +48,8 @@ formats are recognized: ## Authenticated Commands Some actions require that you be logged in to your reddit account. You can login -by pressing u while inside of the program. Once you are logged in, -your username will appear in the top-right corner of the screen. +by pressing the u key. Once you are logged in, your username will +appear in the top-right corner of the screen. - a - Upvote - z - Downvote @@ -65,36 +65,36 @@ your username will appear in the top-right corner of the screen. # Subreddit Mode -The following actions can only be performed when you're viewing a subreddit: +The following actions can be performed when viewing a subreddit: - l or - View the comments for the selected submission (see [submission mode](#submission-mode)) - o or ENTER - Open the selected submission link using your web browser or ``.mailcap`` config - SPACE - Mark the selected submission as *hidden* - p - Toggle between the currently viewed subreddit and ``/r/front`` -- f - Open a prompt to search the current subreddit for a given text string +- f - Open a prompt to search the current subreddit for a text string # Submission Mode -The following actions can be performed when you're viewing a submission: +The following actions can be performed when viewing a submission: - h or - Close the submission and return to the previous page -- l or - View the selected comment using the system's ``$PAGER`` +- l or - View the selected comment using the system's pager - o or ENTER - Open a link in the comment using your web browser or ``.mailcap`` config - SPACE - Fold or expand the selected comment and its children -- b - Send the comment text to the system's ``$URLVIEWER`` application -- J - Move the cursor down the the next comment at the same indentation level +- b - Send the comment text to the system's urlviewer application +- J - Move the cursor down the the next comment at the same indentation - K - Move the cursor up to the parent comment # Subscription Mode -The following actions can be performed when you're viewing your subscriptions or multireddits: +The following actions can be performed when viewing your subscriptions or multireddits: -- h or - Close the subscriptions and return to the previous page +- h or - Close your subscriptions and return to the previous page - l or - Open the selected subreddit or multireddit # Inbox Mode -The following actions can be performed when you're viewing your inbox: +The following actions can be performed when viewing your inbox: - h or - Close your inbox and return to the previous page - l or - View the context of the selected comment diff --git a/rtv/docs.py b/rtv/docs.py index 29322ee..7c01b39 100644 --- a/rtv/docs.py +++ b/rtv/docs.py @@ -29,69 +29,90 @@ Reddit Terminal Viewer https://github.com/michael-lazar/rtv ==================================== -[Commands] - j : Move the cursor down - k : Move the cursor up - n : Move down one page - m : Move up one page - gg : Jump to the first post - G : Jump to the last post - J : Jump to the next sibling comment - K : Jump to the parent comment - 1 : Sort by category 1 - 2 : Sort by category 2 - 3 : Sort by category 3 - 4 : Sort by category 4 - 5 : Sort by category 5 - 6 : Sort by category 6 - 7 : Sort by category 7 - p : Return to the front page - r : Refresh page - u : Login or logout - / : Open the subreddit prompt - f : Open the search prompt - ? : Show the help screen +[Basic Commands] + j : Move the cursor up + k : Move the cursor down + l : View the currently selected item + h : Return to the previous view + m : Move the cursor up one page + n : Move the cursor down one page + gg : Jump to the top of the page + G : Jump to the bottom of the page + 1-7 : Sort submissions by category + r : Refresh the content on the current page + u : Login to your reddit account q : Quit Q : Force quit + y : Copy submission permalink to clipboard + Y : Copy submission link to clipboard + F2 : Cycle to the previous color theme + F3 : Cycle to the next color theme + ? : Show the help screen + / : Open a prompt to select a subreddit + +[Authenticated Commands] a : Upvote z : Downvote - c : Compose a new submission/comment/reply + c : Compose a new submission or comment C : Compose a new private message - e : Edit a submission/comment - d : Delete a submission/comment - i : View inbox - s : Show subscribed subreddits - S : Show subscribed multireddits - w : Save submission/comment, or mark message as read - l : View comments, or open comment in pager - h : Return to the previous page - o : Open the submission/comment URL - SPACE : Hide submission, or fold/expand the selected comment tree - b : Send submission/comment URLs to a urlview program - y : Copy submission permalink to the clipboard - Y : Copy submission/comment URLs to the clipboard - F2 : Cycle to previous theme - F3 : Cycle to next theme + e : Edit the selected submission or comment + d : Delete the selected submission or comment + i : View your inbox (see Inbox Mode) + s : View your subscribed subreddits (see Subscription Mode) + S : View your subscribed multireddits (see Subscription Mode) + u : Logout of your reddit account + w : Save the selected submission or comment + +[Subreddit Mode] + l : View the comments for the selected submission (see Submission Mode) + o : Open the selected submission link using your web browser + SPACE : Mark the selected submission as hidden + p : Toggle between the currently viewed subreddit and /r/front + f : Open a prompt to search the current subreddit for a text string + +[Submission Mode] + h : Close the submission and return to the previous page + l : View the selected comment using the system's pager + o : Open a link in the comment using your web browser + SPACE : Fold or expand the selected comment and its children + b : Send the comment text to the system's urlviewer application + J : Move the cursor down the the next comment at the same indentation + K : Move the cursor up to the parent comment + +[Subscription Mode] + h : Close your subscriptions and return to the previous page + l : Open the selected subreddit or multireddit + +[Inbox Mode] + h : Close your inbox and return to the previous page + l : View the context of the selected comment + o : Open the submission of the selected comment + c : Reply to the selected comment or message + w : Mark the selected comment or message as seen [Prompt] - The `/` prompt accepts subreddits in the following formats + The / key opens a text prompt at the bottom of the screen. You can use this + to type in the name of the subreddit that you want to open. The following + text formats are recognized: - - python - - /r/python - - /r/python/new (sort) - - /r/python/controversial-year (sort and order) - - /r/python/gilded (gilded within subreddit) - - /r/python+linux (multireddit) - - /r/python/comments/30rwj2 (submission comments) - - /comments/30rwj2 (submission comments shorthand) - - /r/front (front page) - - /u/me (your submissions overview) - - /u/me/{saved,hidden} (your saved or hidden posts) - - /u/me/{upvoted,downvoted} (your voted posts) - - /u/spez (a user's submissions overview) - - /u/spez/{submitted,comments} (a user's posts or comments) - - /u/multi-mod/m/android (curated multireddit) - - /domain/python.org (search by domain) + /python - Open a subreddit, shorthand + /r/python - Open a subreddit + /r/python/new - Open a subreddit, sorted by category + /r/python/controversial-year - Open a subreddit, sorted by category and time + /r/python+linux+commandline - Open multiple subreddits merged together + /comments/30rwj2 - Open a submission, shorthand + /r/python/comments/30rwj2 - Open a submission + /r/front - Open your front page + /u/me - View your submissions + /u/me/saved - View your saved content + /u/me/hidden - View your hidden content + /u/me/upvoted - View your upvoted content + /u/me/downvoted - View your downvoted content + /u/spez - View a user's submissions and comments + /u/spez/submitted - View a user's submissions + /u/spez/comments - View a user's comments + /u/multi-mod/m/android - Open a user's curated multireddit + /domain/python.org - Search for links for the given domain """ BANNER_SUBREDDIT = """