File: transform.sh

package info (click to toggle)
clanlib 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 28,372 kB
  • ctags: 16,520
  • sloc: cpp: 101,145; sh: 8,752; xml: 6,410; makefile: 1,740; ansic: 463; perl: 424; php: 247
file content (20 lines) | stat: -rwxr-xr-x 593 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# This script prepares CS documentation for online publication by adding
# user-annotation capability.

DIRS=$@
EFED="perl Utilities/efed.pl"

for d in $DIRS; do
  if test -d $d; then
    echo "Preparing $d for annotation capability."
    $EFED -d \
      -a "/^(.*)\.html/" \
      -r "html=php" \
      -e "s/href *= *\"(?!http\:\/\/)([^\"]*)\.html([^\"]*)\"/href=\"\$1.php\$2\"/gi" \
      -e "s:<title>(.*)</title>:<title>\$1</title><?php \\\$theme=\"\$1\"; ?>:i" \
      -e "s:</body>:<?php require(\"annotate.php\"); ?></body>:i" \
      $d
    cp Utilities/*.php $d
  fi
done