Thread: [Nice-commit] Nice/src/nice/tools/doc api.nice,1.2,1.3 htmlwriter.nice,1.3,1.4 main.nice,1.4,1.5
Brought to you by:
bonniot
From: <fb...@us...> - 2004-03-14 14:58:35
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13535 Modified Files: api.nice htmlwriter.nice main.nice Log Message: api.nice has suffered only some spelling corrections in the comments. main.nice has had very minor changes to comments and printlns to the user. htmlwriter.nice has a much more comprehensive function to convert a string for html veiwing. Some comments have also been updated. Index: api.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/api.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** api.nice 14 Feb 2004 12:40:57 -0000 1.2 --- api.nice 14 Mar 2004 14:49:36 -0000 1.3 *************** *** 35,39 **** // We want to "recompile" that is, load from source, all available ! // packages, so that we can geenrate documentation for them. compilation.recompileAll = true; --- 35,39 ---- // We want to "recompile" that is, load from source, all available ! // packages, so that we can generate documentation for them. compilation.recompileAll = true; *************** *** 52,54 **** // There was an error. Stop working. } ! } --- 52,54 ---- // There was an error. Stop working. } ! } \ No newline at end of file Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** htmlwriter.nice 17 Feb 2004 12:13:02 -0000 1.3 --- htmlwriter.nice 14 Mar 2004 14:49:36 -0000 1.4 *************** *** 183,190 **** } void write(List<bossa.modules.Package> packages) { try { ! BufferedWriter writer = new BufferedWriter ! (new FileWriter(new File(outdir, "index.html"))); writer.write(getHeader("Packages")); writer.write("<b>Packages:</b>\n"); --- 183,193 ---- } + /** This method takes a List containing all the packages that are going to be + * documented. It writes a page at the root of output dir called index.html + * containing a list of hyperlinks to all the packages. + */ void write(List<bossa.modules.Package> packages) { try { ! BufferedWriter writer = new BufferedWriter(new FileWriter(new File(outdir, "index.html"))); writer.write(getHeader("Packages")); writer.write("<b>Packages:</b>\n"); *************** *** 203,212 **** /** Converts a String that may contain characters such as '<' to one that will display ! * properly in html */ String htmlSafe(String s) { ! return ! nice.tools.util.JDK.replaceAll ! (nice.tools.util.JDK.replaceAll(s, "<", "<"), ">", ">"); } --- 206,263 ---- /** Converts a String that may contain characters such as '<' to one that will display ! * properly in html. Submitted by S. Bayer to http://www.rgagnon.com/javadetails/java-0306.html. */ String htmlSafe(String s) { ! StringBuffer sb = new StringBuffer(s.length()); ! //true if last char was blank - this is for handling non-breaking spaces ! boolean lastWasBlankChar = false; ! ! for (int i = 0; i < s.length(); i++) { ! char c = s.charAt(i); ! if (c == ' ') { ! // blank gets extra work, ! // this solves the problem you get if you replace all ! // blanks with , if you do that you lose ! // word breaking ! if (lastWasBlankChar) { ! lastWasBlankChar = false; ! sb.append(" "); ! } ! else { ! lastWasBlankChar = true; ! sb.append(' '); ! } ! } ! else { ! lastWasBlankChar = false; ! // HTML Special Chars ! if (c == '"') ! sb.append("""); ! else if (c == '&') ! sb.append("&"); ! else if (c == '<') ! sb.append("<"); ! else if (c == '>') ! sb.append(">"); ! else if (c == '\n') ! // Handle Newline ! sb.append("<br/>"); ! else { ! //char and int or not related in nice, so we can't do a direct cast ! //hence, we use int(c) instead of (int)c ! int ci = 0xffff & int(c); ! if(ci < 160) ! // nothing special only 7 Bit ! sb.append(c); ! else { ! // Not 7 Bit use the unicode system ! sb.append("&#"); ! sb.append(new Integer(ci).toString()); ! sb.append(';'); ! } ! } ! } ! } ! return sb.toString(); } *************** *** 235,237 **** "</body>\n" + "</html>\n"; ! } --- 286,288 ---- "</body>\n" + "</html>\n"; ! } \ No newline at end of file Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/main.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.nice 16 Feb 2004 15:08:30 -0000 1.4 --- main.nice 14 Mar 2004 14:49:36 -0000 1.5 *************** *** 4,8 **** API documentation generator for Nice. ! @author ? */ --- 4,8 ---- API documentation generator for Nice. ! @author Francis Barber */ *************** *** 25,29 **** (name: "nicedoc", longName: "The Nice Documentation Generator", shortDescription: "Documentation Generator for the Nice programming language", ! author: "Daniel Bonniot <bo...@us...>", seeAlso: "http://nice.sourceforge.net the Nice Home Page\n" + "http://nice.sf.net/compilation.html compilation instructions\n", --- 25,30 ---- (name: "nicedoc", longName: "The Nice Documentation Generator", shortDescription: "Documentation Generator for the Nice programming language", ! author: "Daniel Bonniot <bo...@us...>\n" + ! "Francis Barber <fb...@us...>", seeAlso: "http://nice.sourceforge.net the Nice Home Page\n" + "http://nice.sf.net/compilation.html compilation instructions\n", *************** *** 64,68 **** if (rest.size() > 1) println("Supply only one package on the command line.\n" + ! "nicec will automatically find dependancies."); usage(prg, ERROR); } --- 65,69 ---- if (rest.size() > 1) println("Supply only one package on the command line.\n" + ! "nicecdoc will automatically find dependancies."); usage(prg, ERROR); } *************** *** 77,79 **** generate(compilation, mainPackage, outdir); ! } --- 78,80 ---- generate(compilation, mainPackage, outdir); ! } \ No newline at end of file |