mirror of
https://github.com/processing/processing4.git
synced 2026-02-26 16:54:33 +01:00
Fixed constructor for classes, name for fields, and made 'other' type for references
This commit is contained in:
@@ -11,17 +11,6 @@ REFERENCES_OUT_PATH=../../../processing-website/content/references/translations/
|
||||
echo "[REFERENCE GENERATOR] Source Path :: $PROCESSING_SRC_PATH"
|
||||
echo "[REFERENCE GENERATOR] Library Path :: $PROCESSING_LIB_PATH"
|
||||
|
||||
|
||||
echo "[REFERENCE GENERATOR] Removing previous version of the ref..."
|
||||
rm -rf $REFERENCES_OUT_PATH
|
||||
mkdir $REFERENCES_OUT_PATH
|
||||
mkdir $REFERENCES_OUT_PATH/processing
|
||||
mkdir $REFERENCES_OUT_PATH/io
|
||||
mkdir $REFERENCES_OUT_PATH/net
|
||||
mkdir $REFERENCES_OUT_PATH/serial
|
||||
mkdir $REFERENCES_OUT_PATH/sound
|
||||
mkdir $REFERENCES_OUT_PATH/video
|
||||
|
||||
echo "[REFERENCE GENERATOR] Generating new javadocs..."
|
||||
javadoc -doclet ProcessingWeblet \
|
||||
-docletpath "bin/:lib/org.json.jar" \
|
||||
|
||||
@@ -137,6 +137,9 @@ public class ClassWriter extends BaseWriter {
|
||||
{
|
||||
constructor = constructor.substring(0, constructor.length()-2) + ")";
|
||||
}
|
||||
else {
|
||||
constructor += ")";
|
||||
}
|
||||
constructors.add(constructor);
|
||||
}
|
||||
return constructors;
|
||||
|
||||
@@ -22,16 +22,22 @@ public class FieldWriter extends BaseWriter {
|
||||
|
||||
public static void write(HashMap<String, String> vars, FieldDoc doc, String classname) throws IOException
|
||||
{
|
||||
String filename = getAnchor(doc);
|
||||
TemplateWriter templateWriter = new TemplateWriter();
|
||||
|
||||
JSONObject fieldJSON = new JSONObject();
|
||||
|
||||
String fieldName;
|
||||
if (getName(doc).contains("[]")) {
|
||||
fieldName = getName(doc).replace("[]", "");
|
||||
} else {
|
||||
fieldName = getName(doc);
|
||||
}
|
||||
|
||||
String fileName;
|
||||
if (classname != "") {
|
||||
fileName = jsonDir + classname + "_" + getName(doc) + ".json";
|
||||
fileName = jsonDir + classname + "_" + fieldName + ".json";
|
||||
} else {
|
||||
fileName = jsonDir + getName(doc) + ".json";
|
||||
fileName = jsonDir + fieldName + ".json";
|
||||
}
|
||||
|
||||
Tag[] tags = doc.tags(Shared.i().getWebrefTagName());
|
||||
@@ -40,7 +46,6 @@ public class FieldWriter extends BaseWriter {
|
||||
|
||||
try
|
||||
{
|
||||
fieldJSON.put("type", "field");
|
||||
fieldJSON.put("description", getWebDescriptionFromSource(doc));
|
||||
fieldJSON.put("brief", getWebBriefFromSource(doc));
|
||||
fieldJSON.put("category", category);
|
||||
@@ -49,8 +54,9 @@ public class FieldWriter extends BaseWriter {
|
||||
fieldJSON.put("related", getRelated(doc));
|
||||
|
||||
if(Shared.i().isRootLevel(doc.containingClass())){
|
||||
fieldJSON.put("classname", "");
|
||||
fieldJSON.put("type", "other");
|
||||
} else {
|
||||
fieldJSON.put("type", "field");
|
||||
fieldJSON.put("classanchor", getLocalAnchor(doc.containingClass()));
|
||||
fieldJSON.put("parameters", getParentParam(doc));
|
||||
String syntax = templateWriter.writePartial("field.syntax.partial", getSyntax(doc));
|
||||
|
||||
Reference in New Issue
Block a user