misc/chm-hhc.sh
author Oleksandr Gavenko <gavenkoa@gmail.com>
Thu, 04 Aug 2016 15:31:15 +0300
changeset 2001 4bebef342260
parent 1893 chm-hhc.sh@da0024f4f068
child 2002 812770d563e4
permissions -rwxr-xr-x
Move template files to separate directories.

#!/bin/sh

echo '<html>'
echo '  <head>'
echo '  <meta name="generator" content="html2hhc &lt;gavenkoa@gmail.com&gt;">'
echo '  </head>'
echo '<body>'
echo '<object type="text/site properties">'
echo '  <param name="ImageType" value="Folder">'
echo '</object>'
echo '<ul>'

echo '  <li><object type="text/sitemap">'
echo '    <param name="name" value="index">'
echo '    <param name="local" value="iframe.html">\n'
echo '  </object>'

for file in *.rst *.txt; do
  case $file in
    HEADER.rst) continue;;
  esac
  ext=${file##*.}
  name=${file%.${ext}}
  echo '  <li><object type="text/sitemap">'
  case $ext in
    txt)
      printf '    <param name="name" value="%s">\n' $name
      printf '    <param name="local" value="%s.txt">\n' $name
      ;;
    rst)
      printf '    <param name="name" value="%s">\n' $name
      printf '    <param name="local" value="%s.html">\n' $name
      ;;
  esac
  echo '  </object>'
done

echo '</ul>'
echo '</body>'
echo '</html>'