#!/bin/sh

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

for file in *.rst *.txt; do
  case $file in
    HEADER.rst) continue;
  esac
  ext=${file##*.}
  [ "$ext" = "rst" ] && ext=html
  name=${file%.*}
  case "$1" in
    html) echo "  <li><a href=\"$name.$ext\">$name</a>" ;;
    frame) echo "  <li><a href=\"$name.$ext\" target=\"article\">$name</a>" ;;
    *) exit 1 ;;
  esac
done

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