1
0
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:
Jonas Fonseca 2005-10-04 00:53:03 +02:00 committed by Jonas Fonseca
parent 279f33e985
commit c517dbf101

View File

@ -52,6 +52,15 @@ print_keymap_actions()
{ {
keymap=$1 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" \ grep ACTION_ "$CONFIGDIR/actions-$keymap.inc" \
| while read entry; | while read entry;
do do
@ -61,10 +70,23 @@ print_keymap_actions()
[ "$action" = "none" ] && continue [ "$action" = "none" ] && continue
[ "$action" = " *scripting-function*" ] && continue [ "$action" = " *scripting-function*" ] && continue
echo case "$DOCTYPE" in
echo "$action::" man)
echo " $caption." echo
echo "$action::"
echo " $caption."
;;
html)
printf "%-34s %s\n" "$action" "$caption"
;;
esac
done done
case "$DOCTYPE" in
html)
echo '---------------------------------------------------------------------------------------------------------------'
;;
esac
} }
print_keymap_defaults() print_keymap_defaults()
@ -72,6 +94,15 @@ print_keymap_defaults()
keymap="$1" keymap="$1"
KEYMAP=$(echo $1 | tr '[a-z]' '[A-Z]') 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 '{ "' \ grep ACT_$KEYMAP $KBDBIND | grep '^[[:space:]]{' | grep -v '{ "' \
| while read entry | while read entry
do do
@ -103,10 +134,23 @@ print_keymap_defaults()
*) modifier="" ;; *) modifier="" ;;
esac esac
echo case "$DOCTYPE" in
echo "'$modifier$key'::" man)
echo " $action" echo
echo "'$modifier$key'::"
echo " $action"
;;
html)
printf "%-11s %s\n" "$modifier$key" "$action"
;;
esac
done done
case "$DOCTYPE" in
html)
echo '--------------------------------------------------------------------------------------------'
;;
esac
} }
cat << __END__ cat << __END__