File: html-man

package info (click to toggle)
lmbench 3.0-a9%2Bdebian.1-6
  • links: PTS
  • area: non-free
  • in suites: bookworm
  • size: 2,996 kB
  • sloc: ansic: 12,328; perl: 6,531; sh: 2,784; makefile: 731
file content (83 lines) | stat: -rwxr-xr-x 1,528 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
eval 'exec perl -Ssw $0 "$@"'
	if 0;

# Take a man tree and make an html tree out of it
#
# Derived from Donners man2html script

from=/usr/man
to=/u/eo/repository/system/unix/man

function disambiguate
{
newbase=${1}
newname="${newbase}.1"
dis=2
while [ -a "${newname}" ]
   do
      newname=$newbase"."$dis
      dis=$(expr $dis + 1)
      done
}

while ($ARGV[0] =~ /^-/) {
	if ($ARGV[0] eq "-f") {
		shift(@ARGV);
		$from = shift(@ARGV);
	}
	if ($ARGV[0] eq "-t") {
		shift(@ARGV);
		$to = shift(@ARGV);
	}
}

open(FD, "find $from -name '*.[0-9ln]' -print |");
while ($find = <FD>) {
}

if [ ! "${indexonly}" ]
   then
      print "Processing the man pages ..."
      for i in man${sections}/*
	 do
	    if [ "$verbose" ]
	       then
		  print $i
	       fi
	    # n=${i%.*}
	    name=${to}/${i}
	    if [ -a "${name}" ]
	       then
		  oldname=$name
		  disambiguate $name
		  name=$newname
		  print "Collision - ${oldname} will be stored as ${name}"
	       fi
	    eqn $i | tbl | nroff -man | rman -f HTML | sed -e "s/MS_LOCAL_HOST/${localeo}/g" > ${name}
	    done
   fi

print "Building the index.html files ..."
cd $to
for i in man${sections}
   do
      if [ "$verbose" ]
	 then
	    print $i
	 fi
      cd $i
      rm -f index.html
      echo '<ul>' > ../new.html
      for j in *
	 do
	    if [ "$verbose" ]
	       then
		  print -n "$j "
	       fi
	    print
	    print "<li> <a href=$j>$j</a>" >> ../new.html
	    done
      echo '</ul>' >> ../new.html
      mv ../new.html index.html
      cd ..
      done