mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
elinkskeys(5): Improve the listing of actions and default keybindings
Display them in a table for the HTML version.
This commit is contained in:
parent
279f33e985
commit
c517dbf101
@ -52,6 +52,15 @@ print_keymap_actions()
|
||||
{
|
||||
keymap=$1
|
||||
|
||||
case "$DOCTYPE" in
|
||||
html)
|
||||
# open-link-in-new-tab-in-background
|
||||
echo '`----------------------------------`----------------------------------------------------------------------------'
|
||||
echo 'Action Description'
|
||||
echo '----------------------------------------------------------------------------------------------------------------'
|
||||
;;
|
||||
esac
|
||||
|
||||
grep ACTION_ "$CONFIGDIR/actions-$keymap.inc" \
|
||||
| while read entry;
|
||||
do
|
||||
@ -61,10 +70,23 @@ print_keymap_actions()
|
||||
[ "$action" = "none" ] && continue
|
||||
[ "$action" = " *scripting-function*" ] && continue
|
||||
|
||||
case "$DOCTYPE" in
|
||||
man)
|
||||
echo
|
||||
echo "$action::"
|
||||
echo " $caption."
|
||||
;;
|
||||
html)
|
||||
printf "%-34s %s\n" "$action" "$caption"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case "$DOCTYPE" in
|
||||
html)
|
||||
echo '---------------------------------------------------------------------------------------------------------------'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
print_keymap_defaults()
|
||||
@ -72,6 +94,15 @@ print_keymap_defaults()
|
||||
keymap="$1"
|
||||
KEYMAP=$(echo $1 | tr '[a-z]' '[A-Z]')
|
||||
|
||||
case "$DOCTYPE" in
|
||||
html)
|
||||
# Ctrl-Insert
|
||||
echo '`-----------`-------------------------------------------------------------------------------'
|
||||
echo 'Key Description (Action)'
|
||||
echo '--------------------------------------------------------------------------------------------'
|
||||
;;
|
||||
esac
|
||||
|
||||
grep ACT_$KEYMAP $KBDBIND | grep '^[[:space:]]{' | grep -v '{ "' \
|
||||
| while read entry
|
||||
do
|
||||
@ -103,10 +134,23 @@ print_keymap_defaults()
|
||||
*) modifier="" ;;
|
||||
esac
|
||||
|
||||
case "$DOCTYPE" in
|
||||
man)
|
||||
echo
|
||||
echo "'$modifier$key'::"
|
||||
echo " $action"
|
||||
;;
|
||||
html)
|
||||
printf "%-11s %s\n" "$modifier$key" "$action"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case "$DOCTYPE" in
|
||||
html)
|
||||
echo '--------------------------------------------------------------------------------------------'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
cat << __END__
|
||||
|
Loading…
Reference in New Issue
Block a user