File: mkhtml

package info (click to toggle)
gromacs 4.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 79,700 kB
  • sloc: asm: 789,508; ansic: 424,578; fortran: 94,172; sh: 10,808; makefile: 2,170; cpp: 1,169; csh: 708; perl: 687; python: 264
file content (147 lines) | stat: -rwxr-xr-x 3,906 bytes parent folder | download
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/bin/csh -f

if ( $#argv < 2 ) then
  echo "Error: provide the binary directory as first argument,"
  echo "and the location of programs.txt as the second."
  echo "A html subdirectory will be created in the current dir."
  exit
endif

set GMXBINDIR   = $1
set PROGFILE	= $2

set dir = $cwd

set VER		= 4.5
set MANDIR	= online
set HTML	= $cwd/html
set HTMLOL	= $HTML/$MANDIR
set HTMLIDX	= $HTML/$MANDIR.html

set GENERAL 	= "getting_started:Getting_Started flow:Flow_Chart files:File_Formats mdp_opt:mdp_options"

cd $GMXBINDIR
set PROGRAMS = [a-z]*
cd $dir

echo ""
echo "Generating table of contents in $HTMLIDX"
echo "-------------------------------------------"

if ( ! -d $HTML ) mkdir $HTML
if ( ! -d $HTMLOL ) mkdir $HTMLOL

if ( -f $HTMLIDX ) \rm $HTMLIDX
touch $HTMLIDX

cat > $HTMLIDX << EOD
<HTML>
<HEAD>
<TITLE>GROMACS $VER Online Reference </TITLE>
</HEAD>
<LINK rel=stylesheet href="online/style.css" type="text/css">
<BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990000" alink="#FF0000">

<table WIDTH="98%" NOSAVE NOBORDER >
<TR><TD WIDTH=400>
<TABLE WIDTH=400 NOBORDER>
<TD WIDTH=116>
<a href="http://www.gromacs.org/">
<img SRC="images/gmxlogo_small.jpg" BORDER=0 height=133 width=116></a></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH=280>
<br><br>
<h2>
GROMACS 4.5<br>
Online Reference</h2>
</td>
</TABLE></TD>
<td ALIGN=RIGHT VALIGN=BOTTOM WIDTH="*" NOSAVE>
<B>VERSION 4.5<br>
Thu 26 Aug 2010</B></td>
</tr>
</table>

<hr>

<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=10>
<TR>
<TD VALIGN=top WIDTH="25%">
<h3>General</h3>
EOD
foreach i ( $GENERAL )
  set file = `echo $i | cut -d: -f1`
  set desc = `echo $i | cut -d: -f2 | sed 's/_/ /g'`
  echo "<A HREF="\""$MANDIR/"$file".html"\"">"$desc"</a>" >> $HTMLIDX
  echo "<br><br>" >> $HTMLIDX
end
cat >> $HTMLIDX <<EOD
<A HREF="gmxfaq.html">FAQ</a>
<br>
</TD>
<TD VALIGN=top WIDTH=75%>
<h3>Programs</h3>
<multicol cols=5> 
<A HREF="$MANDIR/options.html">Options</a>
<br>
EOD
foreach program ( $PROGRAMS )
  if ( ( -x $GMXBINDIR/$program ) && ( $program != "my_dssp" ) && ( $program != "GMXRC" ) && ( $program != "completion.csh" ) && ( $program != "completion.zsh" ) && ( $program != "average" ) && ( $program != "completion.bash" ) && ( $program != "luck" ) ) then  
    echo "<br><a href="$MANDIR/$program.html">$program</a>" >> $HTMLIDX
  endif
end
cat >> $HTMLIDX << EOD
</multicol>
</TD>
</TR>
</TABLE>
<HR>
<h3>Programs by Topic</h3>
<multicol cols=3>
EOD
awk -F '|' -v mandir=$MANDIR '{\
  if (NF) {\
    if ( $1 == "HEAD" ) {\
      hnr++;\
      printf("<A HREF=\"#HNR%d\">%s</A><br>\n",hnr,$2);\
    }\
  }\
}' $PROGFILE >> $HTMLIDX
echo "</multicol> " >> $HTMLIDX
awk -F '|' -v mandir=$MANDIR '{\
  if (NF) {\
    if ( $1 == "HEAD" ) {\
      hnr++;\
      printf("\n<A NAME=\"HNR%d\">\n",hnr);\
      printf("<TABLE CELLSPACING=1>\n<TR><TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n");\
      printf("<TR><TD COLSPAN=2><b>%s</b>\n",$2);\
    } else if ( $1 == "END" ) {\
      printf("</TABLE>\n");\
    } else {\
      printf("<TR><TD><A HREF=\"%s/%s.html\">%s</A></TD><TD>%s</TD>\n",mandir,$1,$1,$2);\
    }\
  }\
}' $PROGFILE >> $HTMLIDX
cat >> $HTMLIDX <<EOD
<p>
<hr>
<div ALIGN=RIGHT>
<font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>
</body>
</html>
EOD

echo "Generating html manual for GROMACS programs"
echo "-------------------------------------------"

cd $dir

foreach program ( $PROGRAMS )
  if ( ( -x $GMXBINDIR/$program ) && ( $program != "my_dssp" ) && ( $program != "GMXRC" ) && ( $program != "completion.csh" ) && ( $program != "completion.zsh" ) && ( $program != "average" ) && ( $program != "completion.bash" ) && ( $program != "luck" ) ) then
    echo -n "$program "
    cd $HTMLOL
    $GMXBINDIR/$program -quiet -man html >& /dev/null
    endif
  endif
end

#last line