static void write_wikiman(FILE *out, const char *program, int nldesc, const char **desc, int nfile, t_filenm *fnm, int npargs, t_pargs *pa, int nbug, const char **bugs, gmx_bool bHeader, t_linkdata *links) { int i; char buf[256], link[10]; char *tmp, *tmp2; fprintf(out, "<page>\n<title>Manual:%s_%s</title>\n", program, VERSION); fprintf(out, "<revision>\n"); fprintf(out, "<timestamp>%s</timestamp>\n", mydate(buf, 255, TRUE)); fprintf(out, "<text xml:space=\"preserve\">\n"); if (nldesc > 0) { fprintf(out, "== Description ==\n"); print_tty_formatted(out, nldesc, desc, 0, links, program, TRUE); fprintf(out, "\n"); } if (nbug > 0) { fprintf(out, "== Known Problems ==\n"); for (i = 0; i < nbug; i++) { snew(tmp, strlen(bugs[i])+3); strcpy(tmp, "* "); strcpy(tmp+2, bugs[i]); fprintf(out, "%s\n", NWR(tmp)); sfree(tmp); } } if (nfile > 0) { fprintf(out, "\n== Files ==\n"); pr_html_files(out, nfile, fnm, program, links, TRUE); } if (npargs > 0) { fprintf(out, "\n== Options ==\n"); fprintf(out, " %-12s %-6s %-6s %-s\n", "Option", "Type", "Value", "Description"); fprintf(out, " ------------------------------------------------------\n"); for (i = 0; (i < npargs); i++) { tmp = NWR(pargs_print_line(&pa[i], TRUE)); fprintf(out, "%s", tmp); sfree(tmp); } } fprintf(out, "[[category:Manual_Pages_%s|%s]]\n", VERSION, program); fprintf(out, "</text>\n"); fprintf(out, "</revision>\n"); fprintf(out, "</page>\n\n"); }
static void write_htmlman(FILE *out, const char *program, int nldesc,const char **desc, int nfile,t_filenm *fnm, int npargs,t_pargs *pa, int nbug,const char **bugs, t_linkdata *links) { int i; char link[10],tmp[255]; fprintf(out,"<HTML>\n<HEAD>\n<TITLE>%s</TITLE>\n",program); fprintf(out,"<LINK rel=stylesheet href=\"style.css\" type=\"text/css\">\n"); fprintf(out,"<BODY text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#0000FF\" vlink=\"#990000\" alink=\"#FF0000\">\n"); fprintf(out,"<TABLE WIDTH=\"98%%\" NOBORDER >\n<TR><TD WIDTH=400>\n"); fprintf(out,"<TABLE WIDTH=400 NOBORDER>\n<TD WIDTH=116>\n"); fprintf(out,"<a href=\"http://www.gromacs.org/\">" "<img SRC=\"../images/gmxlogo_small.png\"" "BORDER=0 </a></td>\n"); fprintf(out,"<td ALIGN=LEFT VALIGN=TOP WIDTH=280>" "<br><h2>%s</h2>",program); fprintf(out,"<font size=-1><A HREF=\"../online.html\">Main Table of Contents</A></font><br>"); fprintf(out,"<br></td>\n</TABLE></TD><TD WIDTH=\"*\" ALIGN=RIGHT VALIGN=BOTTOM><p><B>%s<br>\n",GromacsVersion()); fprintf(out,"%s</B></td></tr></TABLE>\n<HR>\n",mydate(tmp,255,FALSE)); if (nldesc > 0) { fprintf(out,"<H3>Description</H3>\n<p>\n"); for(i=0; (i<nldesc); i++) fprintf(out,"%s\n",NSR(desc[i])); } if (nfile > 0) { fprintf(out,"<P>\n"); fprintf(out,"<H3>Files</H3>\n"); pr_html_files(out,nfile,fnm,program,links,FALSE); } if (npargs > 0) { fprintf(out,"<P>\n"); fprintf(out,"<H3>Other options</H3>\n"); fprintf(out, "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>\n" "<TR>" "<TH>option</TH>" "<TH>type</TH>" "<TH>default</TH>" "<TH>description</TH>" "</TR>\n"); for(i=0; (i<npargs); i++) fprintf(out, "<TR>" "<TD ALIGN=RIGHT> <b><tt>%s%s</tt></b> </TD>" "<TD ALIGN=RIGHT> %s </TD>" "<TD ALIGN=RIGHT> <tt>%s</tt> </TD>" "<TD> %s </TD>" "</TD>\n", (pa[i].type == etBOOL)?"-[no]":"-",pa[i].option+1, argtp[pa[i].type],pa_val(&(pa[i]),tmp,255),NSR(pa[i].desc)); fprintf(out,"</TABLE>\n"); } if (nbug > 0) { fprintf(out,"<P>\n"); fprintf(out,"<H3>Known problems</H3>\n"); fprintf(out,"<UL>\n"); for(i=0; (i<nbug); i++) fprintf(out,"<LI>%s\n",NSR(bugs[i])); fprintf(out,"</UL>\n"); } fprintf(out,"<P>\n"); fprintf(out,"<hr>\n<div ALIGN=RIGHT>\n"); fprintf(out,"<font size=\"-1\"><a href=\"http://www.gromacs.org\">" "http://www.gromacs.org</a></font><br>\n"); fprintf(out,"<font size=\"-1\"><a href=\"mailto:[email protected]\">" "[email protected]</a></font><br>\n"); fprintf(out,"</div>\n"); fprintf(out,"</BODY>\n"); }