Skip to content

Conversation

@zdykstra
Copy link
Member

@zdykstra zdykstra commented Oct 29, 2020

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.

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.
@zdykstra zdykstra requested a review from ahesford October 29, 2020 22:06
Copy link
Contributor

@ericonr ericonr left a 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" )
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

@ahesford ahesford left a 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.

@zdykstra zdykstra closed this Oct 30, 2020
zdykstra added a commit that referenced this pull request Oct 30, 2020
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]>
@zdykstra zdykstra deleted the help-system branch October 30, 2020 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants