Properly finalize MPI on mdrun -version. Fixes #1313
[gromacs.git] / admin / mkhtml
blobab1d8a07d66f2f764854cb13665c1680be180178
1 #!/bin/csh -f
3 if ( $#argv < 2 ) then
4 echo "Error: provide the binary directory as first argument,"
5 echo "and the location of programs.txt as the second."
6 echo "A html subdirectory will be created in the current dir."
7 exit
8 endif
10 set GMXBINDIR = $1
11 set PROGFILE = $2
13 set dir = $cwd
15 set VER = 4.6.3
16 set MANDIR = online
17 set HTML = $cwd/html
18 set HTMLOL = $HTML/$MANDIR
19 set HTMLIDX = $HTML/$MANDIR.html
21 set GENERAL = "getting_started:Getting_Started flow:Flow_Chart files:File_Formats mdp_opt:mdp_options"
23 cd $GMXBINDIR
24 set PROGRAMS = [a-z]*
25 cd $dir
27 echo ""
28 echo "Generating table of contents in $HTMLIDX"
29 echo "-------------------------------------------"
31 if ( ! -d $HTML ) mkdir $HTML
32 if ( ! -d $HTMLOL ) mkdir $HTMLOL
34 if ( -f $HTMLIDX ) \rm $HTMLIDX
35 touch $HTMLIDX
37 cat > $HTMLIDX << EOD
38 <HTML>
39 <HEAD>
40 <TITLE>GROMACS $VER Online Reference </TITLE>
41 </HEAD>
42 <LINK rel=stylesheet href="online/style.css" type="text/css">
43 <BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990000" alink="#FF0000">
45 <table WIDTH="98%" NOSAVE NOBORDER >
46 <TR><TD WIDTH=400>
47 <TABLE WIDTH=400 NOBORDER>
48 <TD WIDTH=116>
49 <a href="http://www.gromacs.org/">
50 <img SRC="images/gmxlogo_small.jpg" BORDER=0 height=133 width=116></a></td>
51 <td ALIGN=LEFT VALIGN=TOP WIDTH=280>
52 <br><br>
53 <h2>
54 GROMACS $VER<br>
55 Online Reference</h2>
56 </td>
57 </TABLE></TD>
58 <td ALIGN=RIGHT VALIGN=BOTTOM WIDTH="*" NOSAVE>
59 <B>VERSION $VER</B></td>
60 </tr>
61 </table>
63 <hr>
65 <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=10>
66 <TR>
67 <TD VALIGN=top WIDTH="25%">
68 <h3>General</h3>
69 EOD
70 foreach i ( $GENERAL )
71 set file = `echo $i | cut -d: -f1`
72 set desc = `echo $i | cut -d: -f2 | sed 's/_/ /g'`
73 echo "<A HREF="\""$MANDIR/"$file".html"\"">"$desc"</a>" >> $HTMLIDX
74 echo "<br><br>" >> $HTMLIDX
75 end
76 cat >> $HTMLIDX <<EOD
77 <A HREF="gmxfaq.html">FAQ</a>
78 <br>
79 </TD>
80 <TD VALIGN=top WIDTH=75%>
81 <h3>Programs</h3>
82 <multicol cols=5>
83 <A HREF="$MANDIR/options.html">Options</a>
84 <br>
85 EOD
86 foreach program ( $PROGRAMS )
87 if ( ( -x $GMXBINDIR/$program ) && ( $program != "my_dssp" ) && ( $program != "GMXRC" ) && ( $program != "completion.csh" ) && ( $program != "completion.zsh" ) && ( $program != "average" ) && ( $program != "completion.bash" ) && ( $program != "luck" ) && ( $program != "demux.pl" ) && ( $program != "xplor2gmx.pl" ) ) then
88 echo "<br><a href="$MANDIR/$program.html">$program</a>" >> $HTMLIDX
89 endif
90 end
91 cat >> $HTMLIDX << EOD
92 </multicol>
93 </TD>
94 </TR>
95 </TABLE>
96 <HR>
97 <h3>Programs by Topic</h3>
98 <multicol cols=3>
99 EOD
100 awk -F '|' -v mandir=$MANDIR '{\
101 if (NF) {\
102 if ( $1 == "HEAD" ) {\
103 hnr++;\
104 printf("<A HREF=\"#HNR%d\">%s</A><br>\n",hnr,$2);\
107 }' $PROGFILE >> $HTMLIDX
108 echo "</multicol> " >> $HTMLIDX
109 awk -F '|' -v mandir=$MANDIR '{\
110 if (NF) {\
111 if ( $1 == "HEAD" ) {\
112 hnr++;\
113 printf("\n<A NAME=\"HNR%d\">\n",hnr);\
114 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");\
115 printf("<TR><TD COLSPAN=2><b>%s</b>\n",$2);\
116 } else if ( $1 == "END" ) {\
117 printf("</TABLE>\n");\
118 } else {\
119 printf("<TR><TD><A HREF=\"%s/%s.html\">%s</A></TD><TD>%s</TD>\n",mandir,$1,$1,$2);\
122 }' $PROGFILE >> $HTMLIDX
123 cat >> $HTMLIDX <<EOD
125 <hr>
126 <div ALIGN=RIGHT>
127 <font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>
128 </body>
129 </html>
132 echo "Generating html manual for GROMACS programs"
133 echo "-------------------------------------------"
135 cd $dir
137 setenv GMX_MAXBACKUP -1
138 foreach program ( $PROGRAMS )
139 if ( ( -x $GMXBINDIR/$program ) && ( $program != "my_dssp" ) && ( $program != "GMXRC" ) && ( $program != "completion.csh" ) && ( $program != "completion.zsh" ) && ( $program != "average" ) && ( $program != "completion.bash" ) && ( $program != "luck" ) && ( $program != "demux.pl" ) ) then
140 echo -n "$program "
141 cd $HTMLOL
142 $GMXBINDIR/$program -quiet -man html >& /dev/null
143 cd ..
144 endif
145 endif
147 echo
149 #last line