#!/bin/sh # Note to update an entry without changing the timestamp: # rm entry.html # fix entry.keys # fix entry.notes # ./gen_html if [ "$1" = "--force-all" ]; then forceall=1 fi find -name "*.keys" | while read file; do base=`basename $file .keys` if [ "$forceall" ] || [ ${base}.keys -nt ${base}.html ] || [ ${base}.notes -nt ${base}.html ]; then : else continue fi echo ' linux '$base' keyboard shortcuts
' > ${base}.html if [ -s ${base}.notes ]; then echo '
' >> ${base}.html
    cat ${base}.notes >> ${base}.html
    echo '
' >> ${base}.html fi if [ -s $file ]; then echo ' ' >> ${base}.html IFS=" " while read key action notes; do if [ -z "$key" ]; then echo '' >> ${base}.html else echo " " >> ${base}.html fi done <$file echo '
KeyActionNotes
   
$key$action${notes:- }
' >> ${base}.html fi echo '
' >> ${base}.html if [ ${base}.notes -nt ${base}.keys ]; then touch --reference="${base}.notes" ${base}.html #date by content not presentation else touch --reference="${base}.keys" ${base}.html #date by content not presentation fi done