misc/chm-hhc.sh
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 21 Nov 2018 16:32:43 +0200
changeset 2287 fcdd583e8795
parent 2002 812770d563e4
permissions -rwxr-xr-x
Fixed RST syntax: Inline literal start-string without end-string.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
903
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
echo '<html>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
echo '  <head>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
echo '  <meta name="generator" content="html2hhc &lt;gavenkoa@gmail.com&gt;">'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
echo '  </head>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
echo '<body>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
echo '<object type="text/site properties">'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
echo '  <param name="ImageType" value="Folder">'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
echo '</object>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
echo '<ul>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
echo '  <li><object type="text/sitemap">'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
echo '    <param name="name" value="index">'
1893
da0024f4f068 Remove frame based publishing, stick to iframe. Clean CHM code generation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 903
diff changeset
    15
echo '    <param name="local" value="iframe.html">\n'
903
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
echo '  </object>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
2002
812770d563e4 There are no longer *.txt files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2001
diff changeset
    18
for file in *.rst; do
1893
da0024f4f068 Remove frame based publishing, stick to iframe. Clean CHM code generation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 903
diff changeset
    19
  case $file in
da0024f4f068 Remove frame based publishing, stick to iframe. Clean CHM code generation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 903
diff changeset
    20
    HEADER.rst) continue;;
da0024f4f068 Remove frame based publishing, stick to iframe. Clean CHM code generation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 903
diff changeset
    21
  esac
903
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
  ext=${file##*.}
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
  name=${file%.${ext}}
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
  echo '  <li><object type="text/sitemap">'
2002
812770d563e4 There are no longer *.txt files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2001
diff changeset
    25
  printf '    <param name="name" value="%s">\n' $name
812770d563e4 There are no longer *.txt files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2001
diff changeset
    26
  printf '    <param name="local" value="%s.html">\n' $name
903
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
  echo '  </object>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
done
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
echo '</ul>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
echo '</body>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
echo '</html>'
9ead7d97be34 Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33