chm-hhc.sh
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 12:41:52 +0200
changeset 1903 901e7394849f
parent 1893 da0024f4f068
permissions -rwxr-xr-x
Decrease intent to increase space usage on mobile.

#!/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>'