chm-hhc.sh
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 05 Aug 2015 23:55:34 +0300
changeset 1729 22ffd80639c0
parent 903 9ead7d97be34
child 1893 da0024f4f068
permissions -rw-r--r--
Make centered content design with adoption for mobile devices. Highlight TOC.

#!/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="index-chm.html">\n'
echo '  </object>'

for file in *.rst *.txt; do
  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>'