index.sh
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 21 Oct 2011 14:06:03 +0300
changeset 1059 d5b0b9cc4b49
parent 1031 1febb0de8647
child 1078 bd64c9d8d019
permissions -rwxr-xr-x
Fix indent.

#!/bin/sh

echo '<html>'
echo '<head>'
echo '  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
echo '  <title>Tips</title>'
echo '  <style type="text/css">'
echo '    body { background-color: LightYellow; }'
echo '    a { text-decoration:none; }'
echo '    a:link { color: brown; }'
echo '    a:visited { color: IndianRed; }'
echo '    a:hover { background: bisque; border-radius: 10px; padding: 1px; }'
echo '  </style>'
echo '</head>'
echo '<body>'
echo '<h1>Tips</h1>'
echo '<ul>'

for file in *.rst *.txt; do
  ext=${file##*.}
  name=${file%.${ext}}
  case $ext in
    txt)
      case "$1" in
        chm) printf '  <li><a href="%s.txt">%s</a>\n' $name $name ;;
        frame) printf '  <li><a href="%s.txt" target="article">%s</a>\n' $name $name ;;
      esac
      ;;
    rst)
      case "$1" in
        chm) printf '  <li><a href="%s.html">%s</a>\n' $name $name ;;
        frame) printf '  <li><a href="%s.html" target="article">%s</a>\n' $name $name ;;
      esac
      ;;
  esac
done

echo '<p>'
echo '<address>'
echo '    <a href="mailto:gavenkoa@gmail.com">Oleksandr Gavenko</a>'
echo '</address>'
echo '</body>'
echo '</html>'