-
Notifications
You must be signed in to change notification settings - Fork 95
Embedded help system #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
To enable a global help system, bind alt-h by default to all instances of fzf and sk. The bind executes zfsbootmenu-help -L $_SECTION. Before invoking each instance of fzf/sk, set _SECTION to the appropriate value (MAIN, SNAPSHOT, ...). zfsbootmenu-help then uses this argument to pre-sort the list of topics, pushing that topic to the head of the list / pre-selecting it. The documentation is internal to zfsbootmenu-help, and is created using a very simple templating system with basic colors and text centering. fold is used to word wrap based on the size of the preview window. The preview window size is calculated based on the number of columns minus 26 characters (the longest topic title + fzf marker ). When adding new help sections, care should be taken with colorizing text. Because ANSI escape sequences are used, fold is not able to correctly calculate the length of given word, so it word wraps incorrectly.
ericonr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps use "This operation" instead of "The operation"? I'm not sure on this one.
And switch all of them to "fail gracefully".
| $( colorize lightblue "[ALT+C] cmdline" ) | ||
| Temporarily edit the kernel command line that will be used to boot the next kernel and boot environment. This change is not persisted between boots. | ||
|
|
||
| $( colorize lightblue "[ALT+P] Pool status" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the capitalization? Here it's Pool status, but above it's set bootfs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was mirroring the descriptions used in the footer. Those should probably get a normalization pass next.
ahesford
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit to use $HELP_SECTION instead of $_SECTION to make the meaning more obvious, and believe I've made the global variable unnecessary. Please look over the commit. If you think these are positive changes, please squash; otherwise, just drop the commit.
Beyond this, the grammatical changes should be made but are not reflected in my commit.
Enable a global help system, bind alt-h by default to all instances of fzf and sk. The bind executes zfsbootmenu-help -L $HELP_SECTION. Before invoking each instance of fzf/sk, set HELP_SECTION to the appropriate value (MAIN, SNAPSHOT, ...). zfsbootmenu-help then uses this argument to pre-sort the list of topics, pushing that topic to the head of the list / pre-selecting it. The documentation is internal to zfsbootmenu-help, and is created using a very simple templating system with basic colors and text centering. fold is used to word wrap based on the size of the preview window. The preview window size is calculated based on the number of columns minus 26 characters (the longest topic title + fzf marker ). When adding new help sections, care should be taken with colorizing text. Because ANSI escape sequences are used, fold is not able to correctly calculate the length of given word, so it word wraps incorrectly. Closes #92 Co-authored-by: Zach Dykstra <[email protected]> Co-authored-by: Andrew J. Hesford <[email protected]>
To enable a global help system, bind alt-h by default to all instances
of fzf and sk. The bind executes zfsbootmenu-help -L $_SECTION.
Before invoking each instance of fzf/sk, set _SECTION to the appropriate
value (MAIN, SNAPSHOT, ...). zfsbootmenu-help then uses this argument to
pre-sort the list of topics, pushing that topic to the head of the list
/ pre-selecting it.
The documentation is internal to zfsbootmenu-help, and is created using
a very simple templating system with basic colors and text centering.
fold is used to word wrap based on the size of the preview window. The
preview window size is calculated based on the number of columns minus
26 characters (the longest topic title + fzf marker ).
When adding new help sections, care should be taken with colorizing
text. Because ANSI escape sequences are used, fold is not able to
correctly calculate the length of given word, so it word wraps
incorrectly.
The text / pager can be reviewed by manually executing
90zfsbootmenu/zfsbootmenu-help.sh.