Changed the header of the generated JRE emulation wiki doc and modified the WikiDoclet to prefix any wiki-words (WordsLikeThis) with '!' so Google Code doesn't try to automatically turn them into links.
Review by: scottb
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@3643 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/build-tools/doctool/src/com/google/doctool/custom/WikiDoclet.java b/build-tools/doctool/src/com/google/doctool/custom/WikiDoclet.java
index db0f078..663dfef 100644
--- a/build-tools/doctool/src/com/google/doctool/custom/WikiDoclet.java
+++ b/build-tools/doctool/src/com/google/doctool/custom/WikiDoclet.java
@@ -33,6 +33,7 @@
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
+import java.util.regex.Pattern;
/**
* A doclet for using producing wiki output listing the specified classes and
@@ -40,12 +41,18 @@
*/
public class WikiDoclet {
+ private static final String JAVADOC_URL = "http://java.sun.com/j2se/1.5.0/docs/api/";
private static final String OPT_WKHEADER = "-wkhead";
private static final String OPT_WKOUT = "-wkout";
- private static final String JAVADOC_URL = "http://java.sun.com/j2se/1.5.0/docs/api/";
private static WikiDoclet sWikiDoclet;
+ /*
+ * Finds any compound Pascal-cased words (LikeThisExample), which Google Code
+ * will try to interpret as wiki links.
+ */
+ private static final Pattern wikiWordPattern = Pattern.compile("\\b([A-Z]+\\w+[A-Z]+\\w*)\\b");
+
public static int optionLength(String option) {
if (option.equals(OPT_WKOUT)) {
return 2;
@@ -67,6 +74,11 @@
return getDoclet().analyzeOptions(options, reporter);
}
+ private static String escapeWikiWords(String text) {
+ // Prefix each match with '!' to suppress automatic wiki-linking
+ return wikiWordPattern.matcher(text).replaceAll("!$1");
+ }
+
private static WikiDoclet getDoclet() {
if (sWikiDoclet == null) {
sWikiDoclet = new WikiDoclet();
@@ -101,7 +113,7 @@
Iterator<ExecutableMemberDoc> iter = members.iterator();
while (iter.hasNext()) {
ExecutableMemberDoc member = iter.next();
- buffer.append(member.name() + member.flatSignature());
+ buffer.append(escapeWikiWords(member.name() + member.flatSignature()));
if (iter.hasNext()) {
buffer.append(", ");
}
diff --git a/doc/src/RefJreHeader.wiki b/doc/src/RefJreHeader.wiki
index 9e7fcec..f018d3d 100644
--- a/doc/src/RefJreHeader.wiki
+++ b/doc/src/RefJreHeader.wiki
@@ -1,4 +1,4 @@
-#summary JRE Emulation Library
+#summary The JRE types and methods that GWT emulates.
=JRE Emulation=
Google Web Toolkit includes a library that emulates a subset of the Java runtime library. The list below shows the set of JRE types and methods that GWT can translate automatically. Note that in some cases, only a subset of methods is supported for a given type.