提交 afc79522 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation: the grammar and function documentation can now be easier translated.

上级 48a2b4f5
...@@ -376,7 +376,7 @@ SET IGNORECASE { TRUE | FALSE } ...@@ -376,7 +376,7 @@ SET IGNORECASE { TRUE | FALSE }
If IGNORECASE is enabled, text columns in newly created tables will be If IGNORECASE is enabled, text columns in newly created tables will be
case-insensitive." case-insensitive."
"Commands (Other)","SET LOG"," "Commands (Other)","SET LOG","
SET LOCK_MODE int SET LOG int
"," ","
Sets the transaction log mode." Sets the transaction log mode."
"Commands (Other)","SET LOCK_MODE"," "Commands (Other)","SET LOCK_MODE","
...@@ -819,39 +819,39 @@ The sample variance (square of the sample standard deviation)." ...@@ -819,39 +819,39 @@ The sample variance (square of the sample standard deviation)."
"Functions (Numeric)","ABS"," "Functions (Numeric)","ABS","
ABS ( { int | long | decimal | double } ) ABS ( { int | long | decimal | double } )
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","ACOS"," "Functions (Numeric)","ACOS","
ACOS(double) ACOS(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","ASIN"," "Functions (Numeric)","ASIN","
ASIN(double) ASIN(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","ATAN"," "Functions (Numeric)","ATAN","
ATAN(double) ATAN(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","COS"," "Functions (Numeric)","COS","
COS(double) COS(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","COT"," "Functions (Numeric)","COT","
COT(double) COT(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","SIN"," "Functions (Numeric)","SIN","
SIN(double) SIN(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","TAN"," "Functions (Numeric)","TAN","
TAN(double) TAN(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","ATAN2"," "Functions (Numeric)","ATAN2","
ATAN2(double, double) ATAN2(double, double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","BITAND"," "Functions (Numeric)","BITAND","
BITAND(long, long) BITAND(long, long)
"," ","
...@@ -871,43 +871,43 @@ The modulo operation." ...@@ -871,43 +871,43 @@ The modulo operation."
"Functions (Numeric)","CEILING"," "Functions (Numeric)","CEILING","
CEILING(double) CEILING(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","DEGREES"," "Functions (Numeric)","DEGREES","
DEGREES(double) DEGREES(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","EXP"," "Functions (Numeric)","EXP","
EXP(double) EXP(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","FLOOR"," "Functions (Numeric)","FLOOR","
FLOOR(double) FLOOR(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","LOG"," "Functions (Numeric)","LOG","
LOG(double) LOG(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","LOG10"," "Functions (Numeric)","LOG10","
LOG10(double) LOG10(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","RADIANS"," "Functions (Numeric)","RADIANS","
RADIANS(double) RADIANS(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","SQRT"," "Functions (Numeric)","SQRT","
SQRT(double) SQRT(double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","PI"," "Functions (Numeric)","PI","
PI() PI()
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","POWER"," "Functions (Numeric)","POWER","
POWER(double, double) POWER(double, double)
"," ","
See also Java Math." See also Java ""Math."
"Functions (Numeric)","RAND"," "Functions (Numeric)","RAND","
RAND( [ int ] ) RAND( [ int ] )
"," ","
...@@ -999,7 +999,7 @@ Converts a string to the hex representation." ...@@ -999,7 +999,7 @@ Converts a string to the hex representation."
"Functions (String)","INSTR"," "Functions (String)","INSTR","
INSTR(string, searchString, [, startInt]) INSTR(string, searchString, [, startInt])
"," ","
Returns the location of a search string in a string (s)." Returns the location of a search string in a string."
"Functions (String)","INSERT Function"," "Functions (String)","INSERT Function","
INSERT(originalString, startInt, lengthInt, addString) INSERT(originalString, startInt, lengthInt, addString)
"," ","
...@@ -1091,7 +1091,7 @@ Decodes a byte array in the UTF8 format to a string." ...@@ -1091,7 +1091,7 @@ Decodes a byte array in the UTF8 format to a string."
"Functions (String)","XMLATTR"," "Functions (String)","XMLATTR","
XMLATTR(nameString, valueString) XMLATTR(nameString, valueString)
"," ","
Creates an XML attribute element of the form name=""value""." Creates an XML attribute element of the form ""name=value""."
"Functions (String)","XMLNODE"," "Functions (String)","XMLNODE","
XMLNODE(elementString [, attributesString [, contentString]]) XMLNODE(elementString [, attributesString [, contentString]])
"," ","
...@@ -1107,7 +1107,7 @@ Creates an XML CDATA element." ...@@ -1107,7 +1107,7 @@ Creates an XML CDATA element."
"Functions (String)","XMLSTARTDOC"," "Functions (String)","XMLSTARTDOC","
XMLSTARTDOC() XMLSTARTDOC()
"," ","
The string '<?xml version=""1." The string ""<?xml version='1."
"Functions (String)","XMLTEXT"," "Functions (String)","XMLTEXT","
XMLTEXT(valueString) XMLTEXT(valueString)
"," ","
......
...@@ -151,6 +151,7 @@ public class GenerateDoc { ...@@ -151,6 +151,7 @@ public class GenerateDoc {
// text is enclosed in <p> .. </p> so this works. // text is enclosed in <p> .. </p> so this works.
text = StringUtils.replaceAll(text, "<br /><br />", "</p><p>"); text = StringUtils.replaceAll(text, "<br /><br />", "</p><p>");
text = StringUtils.replaceAll(text, "<br />", " "); text = StringUtils.replaceAll(text, "<br />", " ");
text = addCode(text);
map.put("text", text); map.put("text", text);
} }
...@@ -174,4 +175,56 @@ public class GenerateDoc { ...@@ -174,4 +175,56 @@ public class GenerateDoc {
JdbcUtils.closeSilently(stat); JdbcUtils.closeSilently(stat);
} }
} }
private String addCode(String text) {
text = StringUtils.replaceAll(text, "&quot;", "\"");
StringBuilder buff = new StringBuilder(text.length());
int len = text.length();
boolean code = false, codeQuoted = false;
for (int i = 0; i < len; i++) {
char c = text.charAt(i);
if (i < len - 1) {
char next = text.charAt(i+1);
if (!code && !codeQuoted) {
if (Character.isUpperCase(c) && Character.isUpperCase(next)) {
buff.append("<code>");
code = true;
} else if (c == '\"' && (i == 0 || text.charAt(i - 1) != '\\')) {
buff.append("<code>");
codeQuoted = true;
continue;
}
}
}
if (code) {
if (!Character.isLetterOrDigit(c) && "_.".indexOf(c) < 0) {
buff.append("</code>");
code = false;
}
} else if (codeQuoted && c == '\"') {
buff.append("</code>");
codeQuoted = false;
continue;
}
buff.append(c);
}
if (code) {
buff.append("</code>");
}
String s = buff.toString();
s = StringUtils.replaceAll(s, "</code>, <code>", ", ");
s = StringUtils.replaceAll(s, ".</code>", "</code>.");
s = StringUtils.replaceAll(s, ",</code>", "</code>.");
s = StringUtils.replaceAll(s, " @<code>", " <code>@");
s = StringUtils.replaceAll(s, "</code> <code>", " ");
s = StringUtils.replaceAll(s, "<code>SQL</code>", "SQL");
s = StringUtils.replaceAll(s, "<code>XML</code>", "XML");
s = StringUtils.replaceAll(s, "<code>URL</code>", "URL");
s = StringUtils.replaceAll(s, "<code>URLs</code>", "URLs");
s = StringUtils.replaceAll(s, "<code>HTML</code>", "HTML");
s = StringUtils.replaceAll(s, "<code>KB</code>", "KB");
s = StringUtils.replaceAll(s, "<code>MB</code>", "MB");
s = StringUtils.replaceAll(s, "<code>GB</code>", "GB");
return s;
}
} }
...@@ -655,4 +655,4 @@ licensing appreciate textbook diligence undergraduate afaik mathematics chris ...@@ -655,4 +655,4 @@ licensing appreciate textbook diligence undergraduate afaik mathematics chris
arrangements bugfix premain longs majority crashing behaving inst inventor arrangements bugfix premain longs majority crashing behaving inst inventor
javaagent park accurately adopt consists night equally enhance enhanced javaagent park accurately adopt consists night equally enhance enhanced
skiing honor marketing sleeping dlucene timezones shifted analyzed insists skiing honor marketing sleeping dlucene timezones shifted analyzed insists
train joining bilingual existed train joining bilingual existed extremely fog
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论