[rkward] packages/rkwarddev: think i'm through with the script rewrite

m.eik michalke meik.michalke at uni-duesseldorf.de
Tue Nov 24 20:54:34 UTC 2015


Git commit 6846cf7e6247b06b5c021bb31e52578bf5be60bb by m.eik michalke.
Committed on 24/11/2015 at 20:45.
Pushed by meikm into branch 'master'.

think i'm through with the script rewrite

  - there remain some ite() calls, because touching them opens the gates to recursion hell.
    it was never a problem to nest ite() calls as much as you like, js() is not so graceful yet

M  +116  -56   packages/rkwarddev/demo/skeleton_dialog.R
M  +7    -1    packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap
M  +73   -70   packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js
M  +16   -12   packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh
M  +6    -2    packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml

http://commits.kde.org/rkward/6846cf7e6247b06b5c021bb31e52578bf5be60bb

diff --git a/packages/rkwarddev/demo/skeleton_dialog.R b/packages/rkwarddev/demo/skeleton_dialog.R
index 7042828..c40ebad 100644
--- a/packages/rkwarddev/demo/skeleton_dialog.R
+++ b/packages/rkwarddev/demo/skeleton_dialog.R
@@ -366,11 +366,25 @@ JS.prepare <- rk.paste.JS(
   rk.JS.vars(outDir, overwrite, guessGetters),
   echo("rkwarddev.required(\"0.07-4\")"),
   echo("\n\n# define where the plugin should write its files\noutput.dir <- "),
-  ite(outDir, echo("\"", outDir, "\""), echo("tempdir()")),
-  echo("\n# overwrite an existing plugin in output.dir?\noverwrite <- "),
-  ite(overwrite, echo("TRUE"), echo("FALSE")),
-  echo("\n# if you set guess.getters to TRUE, the resulting code will need RKWard >= 0.6.0\nguess.getter <- "),
-  ite(guessGetters, echo("TRUE"), echo("FALSE")),
+  js(
+    if(outDir){
+      echo("\"", outDir, "\"")
+    } else {
+      echo("tempdir()")
+    },
+    echo("\n# overwrite an existing plugin in output.dir?\noverwrite <- "),
+    if(overwrite){
+      echo("TRUE")
+    } else {
+      echo("FALSE")
+    },
+    echo("\n# if you set guess.getters to TRUE, the resulting code will need RKWard >= 0.6.0\nguess.getter <- "),
+    if(guessGetters){
+      echo("TRUE")
+    } else {
+      echo("FALSE")
+    }
+  ),
   echo("\n\n"),
   level=2)
   
@@ -381,7 +395,11 @@ JS.calculate <- rk.paste.JS(
   js.opt.skel.pluginmap,
   js.opt.skeleton,
   echo("aboutPlugin <- rk.XML.about("),
-    ite(pluginName, echo("\n\tname=\"", pluginName, "\"")),
+    js(
+      if(pluginName){
+        echo("\n\tname=\"", pluginName, "\"")
+      } else {}
+    ),
     # author section
     rk.JS.optionset(optionsetAuthors, vars=TRUE, guess.getter=TRUE),
     ite(id(optcolAuthorGivenName, " != \"\""),
@@ -389,15 +407,33 @@ JS.calculate <- rk.paste.JS(
         echo("\tauthor=c(\n\t\t\t"),
         rk.JS.optionset(optionsetAuthors,
           js.optionsetAuthors.role <- rk.JS.options("optAuthorRole",
-            ite(id(optcolAuthorAut, " == 1"), qp("\"aut\"")),
-            ite(id(optcolAuthorCre, " == 1"), qp("\"cre\"")),
-            ite(id(optcolAuthorCtb, " == 1"), qp("\"ctb\"")),
+            .ite=js(
+              if(optcolAuthorAut == 1){
+                qp("\"aut\"")
+              } else {},
+              if(optcolAuthorCre == 1){
+                qp("\"cre\"")
+              } else {},
+              if(optcolAuthorCtb == 1){
+                qp("\"ctb\"")
+              } else {},
+              keep.ite=TRUE
+            ),
             funct="c", option="role", collapse=""),
           echo("person("),
           echo("given=\"", optcolAuthorGivenName, "\""),
-          ite(optcolAuthorFamiliyName, echo(", family=\"", optcolAuthorFamiliyName, "\"")),
-          ite(optcolAuthorMail, echo(", email=\"", optcolAuthorMail, "\"")),
-          ite(js.optionsetAuthors.role, echo(js.optionsetAuthors.role)),
+          js(
+            if(optcolAuthorFamiliyName){
+              echo(", family=\"", optcolAuthorFamiliyName, "\"")
+            } else {},
+            if(optcolAuthorMail){
+              echo(", email=\"", optcolAuthorMail, "\"")
+            } else {},
+            if(js.optionsetAuthors.role){
+              echo(js.optionsetAuthors.role)
+            } else {},
+            level=3
+          ),
           echo(")"),
           collapse=",\\n\\t\\t\\t"
         ),
@@ -409,65 +445,89 @@ JS.calculate <- rk.paste.JS(
   ite(id(js.frm.dependencyFrame, " && (", js.opt.about.dep, " || ", optcolPckgName, ")"),
     rk.paste.JS(
       echo("plugin.dependencies <- rk.XML.dependencies("),
-      ite(id(js.opt.about.dep), echo(js.opt.about.dep)),
-      ite(id(js.opt.about.dep, " && ", optcolPckgName), echo(",")),
+      js(
+        if(js.opt.about.dep){
+          echo(js.opt.about.dep)
+        } else {},
+        if(js.opt.about.dep && optcolPckgName){
+          echo(",")
+        } else {},
+        level=3
+      ),
       ite(id(optcolPckgName , "!= \"\""),
         rk.paste.JS(
           echo("\n\tpackage=list(\n\t\t"),
           rk.JS.optionset(dependencyOptionset,
             echo("c("),
             echo("name=\"", optcolPckgName, "\""),
-            ite(optcolPckgMin, echo(", min=\"", optcolPckgMin, "\"")),
-            ite(optcolPckgMax, echo(", max=\"", optcolPckgMax, "\"")),
-            ite(optcolPckgRepo, echo(", repository=\"", optcolPckgRepo, "\"")),
+            js(
+              if(optcolPckgMin){
+                echo(", min=\"", optcolPckgMin, "\"")
+              } else {},
+              if(optcolPckgMax){
+                echo(", max=\"", optcolPckgMax, "\"")
+              } else {},
+              if(optcolPckgRepo){
+                echo(", repository=\"", optcolPckgRepo, "\"")
+              } else {},
+              level=5
+            ),
             echo(")"),
             collapse=",\\n\\t\\t"
           ),
-          echo("\n\t)")
+          echo("\n\t)"),
+          level=4
         )
       ),
       echo("\n)\n\n"),
     level=3)),
   echo("# name of the main component, relevant for help page content\nrk.set.comp(\""),
-  ite(menuName,
-    echo(menuName, "\")\n\n"),
-    echo(pluginName, "\")\n\n")
-  ),
-  echo("############\n## your plugin dialog and JavaScript should be put here\n############\n\n"),
-  ite(js.frm.helpText,
-    rk.paste.JS(
-      echo("############\n## help page\nplugin.summary <- rk.rkh.summary(\n\t"),
-      ite(helpSummary, echo("\"", helpSummary, "\"\n)"), echo("\"", pluginDescription, "\"\n)")),
-      echo("\nplugin.usage <- rk.rkh.usage(\n\t\"", helpUsage, "\"\n)\n\n"),
-    level=3)),
-  echo("#############\n",
-    "## the main call\n",
-    "## if you run the following function call, files will be written to output.dir!\n",
-    "#############\n",
-    "# this is where things get serious, that is, here all of the above is put together into one plugin\n",
-    "plugin.dir <- rk.plugin.skeleton(\n\tabout=aboutPlugin,"),
-  ite(
-    id(js.frm.dependencyFrame, " && ", js.opt.about.dep),
-    echo("\n\tdependencies=plugin.dependencies,"),
-    echo("\n\t#dependencies=plugin.dependencies,")
-  ),
-  echo("\n\tpath=output.dir,",
-    "\n\tguess.getter=guess.getter,",
-    "\n\tscan=c(\"var\", \"saveobj\", \"settings\"),",
-    "\n\txml=list(\n\t\t#dialog=,\n\t\t#wizard=,\n\t\t#logic=,\n\t\t#snippets=\n\t),",
-    "\n\tjs=list(\n\t\t#results.header=FALSE,\n\t\t#load.silencer=,\n\t\t#require=,\n\t\t#variables=,",
-      "\n\t\t#globals=,\n\t\t#preprocess=,\n\t\t#calculate=,\n\t\t#printout=,\n\t\t#doPrintout=\n\t),"
-  ),
-  ite(js.frm.helpText,
-    echo(
-      "\n\trkh=list(\n\t\tsummary=plugin.summary,\n\t\tusage=plugin.usage#,",
-      "\n\t\t#sections=,\n\t\t#settings=,\n\t\t#related=,\n\t\t#technical=\n\t),",
-      "\n\tcreate=c(\"pmap\", \"xml\", \"js\", \"desc\", \"rkh\"),"
+  js(
+    if(menuName){
+      echo(menuName, "\")\n\n")
+    } else {
+      echo(pluginName, "\")\n\n")
+    },
+    echo("############\n## your plugin dialog and JavaScript should be put here\n############\n\n"),
+    if(js.frm.helpText){
+      echo("############\n## help page\nplugin.summary <- rk.rkh.summary(\n\t")
+      if(helpSummary){
+        echo("\"", helpSummary, "\"\n)")
+      } else {
+        echo("\"", pluginDescription, "\"\n)")
+      }
+      echo("\nplugin.usage <- rk.rkh.usage(\n\t\"", helpUsage, "\"\n)\n\n")
+    } else {},
+    echo("#############\n",
+      "## the main call\n",
+      "## if you run the following function call, files will be written to output.dir!\n",
+      "#############\n",
+      "# this is where things get serious, that is, here all of the above is put together into one plugin\n",
+      "plugin.dir <- rk.plugin.skeleton(\n\tabout=aboutPlugin,"),
+    if(js.frm.dependencyFrame && js.opt.about.dep){
+      echo("\n\tdependencies=plugin.dependencies,")
+    } else {
+      echo("\n\t#dependencies=plugin.dependencies,")
+    },
+    echo("\n\tpath=output.dir,",
+      "\n\tguess.getter=guess.getter,",
+      "\n\tscan=c(\"var\", \"saveobj\", \"settings\"),",
+      "\n\txml=list(\n\t\t#dialog=,\n\t\t#wizard=,\n\t\t#logic=,\n\t\t#snippets=\n\t),",
+      "\n\tjs=list(\n\t\t#results.header=FALSE,\n\t\t#load.silencer=,\n\t\t#require=,\n\t\t#variables=,",
+        "\n\t\t#globals=,\n\t\t#preprocess=,\n\t\t#calculate=,\n\t\t#printout=,\n\t\t#doPrintout=\n\t),"
     ),
-    echo("\n\trkh=list(","\n\t\t#summary=,\n\t\t#usage=,",
-      "\n\t\t#sections=,\n\t\t#settings=,\n\t\t#related=,\n\t\t#technical=\n\t),",
-      "\n\tcreate=c(\"pmap\", \"xml\", \"js\", \"desc\"),"
-    )
+    if(js.frm.helpText){
+      echo(
+        "\n\trkh=list(\n\t\tsummary=plugin.summary,\n\t\tusage=plugin.usage#,",
+        "\n\t\t#sections=,\n\t\t#settings=,\n\t\t#related=,\n\t\t#technical=\n\t),",
+        "\n\tcreate=c(\"pmap\", \"xml\", \"js\", \"desc\", \"rkh\"),"
+      )
+    } else {
+      echo("\n\trkh=list(","\n\t\t#summary=,\n\t\t#usage=,",
+        "\n\t\t#sections=,\n\t\t#settings=,\n\t\t#related=,\n\t\t#technical=\n\t),",
+        "\n\tcreate=c(\"pmap\", \"xml\", \"js\", \"desc\"),"
+      )
+    }
   ),
   echo("\n\toverwrite=overwrite,"),
   echo("\n\t#components=list(),"),
diff --git a/packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap b/packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap
index 0aef4d7..09cc3ca 100644
--- a/packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap
+++ b/packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap
@@ -6,6 +6,12 @@
   po_id="CreateRKWardpluginskeleton_rkward"
   priority="medium"
 >
+  <!-- 
+    this code was generated using the rkwarddev package.
+    perhaps don't make changes here, but in the rkwarddev script instead!
+    
+    look for a file called: $SRC/demo/skeleton_dialog.R 
+  -->
   <dependencies rkward_min_version="0.6.0">
   </dependencies>
   <about 
@@ -13,7 +19,7 @@
     shortinfo="GUI interface to create RKWard plugin skeletons"
     longinfo="GUI interface to create RKWard plugin skeletons"
     version="0.07-4"
-    releasedate="2015-11-22"
+    releasedate="2015-11-24"
     url="http://rkward.kde.org"
     license="GPL (>= 3)"
   >
diff --git a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js
index 2e89ece..366c556 100644
--- a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js
+++ b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js
@@ -1,4 +1,7 @@
-
+// this code was generated using the rkwarddev package.
+// perhaps don't make changes here, but in the rkwarddev script instead!
+// 
+// look for a file called: $SRC/demo/skeleton_dialog.R
 
 
 
@@ -12,21 +15,21 @@ function preprocess(){
   echo("rkwarddev.required(\"0.07-4\")");
   echo("\n\n# define where the plugin should write its files\noutput.dir <- ");
   if(outDir) {
-    echo("\"" + outDir + "\"");
+    echo("\"" + outDir + "\"");  
   } else {
-    echo("tempdir()");
+    echo("tempdir()");  
   }
   echo("\n# overwrite an existing plugin in output.dir?\noverwrite <- ");
   if(overwrite) {
-    echo("TRUE");
+    echo("TRUE");  
   } else {
-    echo("FALSE");
+    echo("FALSE");  
   }
   echo("\n# if you set guess.getters to TRUE, the resulting code will need RKWard >= 0.6.0\nguess.getter <- ");
   if(guessGetters) {
-    echo("TRUE");
+    echo("TRUE");  
   } else {
-    echo("FALSE");
+    echo("FALSE");  
   }
   echo("\n\n");
 }
@@ -83,32 +86,32 @@ function calculate(){
   // define the array arrOptAbout for values of R option "about"
   var arrOptAbout = new Array();
     if(pluginDescription) {
-      arrOptAbout.push("desc=\"" + pluginDescription + "\"");
+      arrOptAbout.push("desc=\"" + pluginDescription + "\""  );
     } else {
       arrOptAbout.push();
     }
     if(pluginVersion) {
-      arrOptAbout.push("version=\"" + pluginVersion + "\"");
+      arrOptAbout.push("version=\"" + pluginVersion + "\""  );
     } else {
       arrOptAbout.push();
     }
     if(pluginDate) {
-      arrOptAbout.push("date=\"" + pluginDate + "\"");
+      arrOptAbout.push("date=\"" + pluginDate + "\""  );
     } else {
       arrOptAbout.push();
     }
     if(pluginHomepage) {
-      arrOptAbout.push("url=\"" + pluginHomepage + "\"");
+      arrOptAbout.push("url=\"" + pluginHomepage + "\""  );
     } else {
       arrOptAbout.push();
     }
     if(pluginLicense) {
-      arrOptAbout.push("license=\"" + pluginLicense + "\"");
+      arrOptAbout.push("license=\"" + pluginLicense + "\""  );
     } else {
       arrOptAbout.push();
     }
     if(pluginCategory) {
-      arrOptAbout.push("category=\"" + pluginCategory + "\"");
+      arrOptAbout.push("category=\"" + pluginCategory + "\""  );
     } else {
       arrOptAbout.push();
     }
@@ -124,22 +127,22 @@ function calculate(){
   // define the array arrOptDependencies for values of R option "dependencies"
   var arrOptDependencies = new Array();
     if(dependencyFrameChecked && RKMin) {
-      arrOptDependencies.push("rkward.min=\"" + RKMin + "\"");
+      arrOptDependencies.push("rkward.min=\"" + RKMin + "\""  );
     } else {
       arrOptDependencies.push();
     }
     if(dependencyFrameChecked && RKMax) {
-      arrOptDependencies.push("rkward.max=\"" + RKMax + "\"");
+      arrOptDependencies.push("rkward.max=\"" + RKMax + "\""  );
     } else {
       arrOptDependencies.push();
     }
     if(dependencyFrameChecked && RMin) {
-      arrOptDependencies.push("R.min=\"" + RMin + "\"");
+      arrOptDependencies.push("R.min=\"" + RMin + "\""  );
     } else {
       arrOptDependencies.push();
     }
     if(dependencyFrameChecked && RMax) {
-      arrOptDependencies.push("R.max=\"" + RMax + "\"");
+      arrOptDependencies.push("R.max=\"" + RMax + "\""  );
     } else {
       arrOptDependencies.push();
     }
@@ -155,12 +158,12 @@ function calculate(){
   // define the array arrOptPluginmap for values of R option "pluginmap"
   var arrOptPluginmap = new Array();
     if(menuName) {
-      arrOptPluginmap.push("name=\"" + menuName + "\"");
+      arrOptPluginmap.push("name=\"" + menuName + "\""  );
     } else {
-      arrOptPluginmap.push("name=\"" + pluginName + "\"");
+      arrOptPluginmap.push("name=\"" + pluginName + "\""  );
     }
     if(menuHier) {
-      arrOptPluginmap.push("hierarchy=\"" + menuHier + "\"");
+      arrOptPluginmap.push("hierarchy=\"" + menuHier + "\""  );
     } else {
       arrOptPluginmap.push();
     }
@@ -176,34 +179,34 @@ function calculate(){
   // define the array arrOptSkeleton for values of R option ""
   var arrOptSkeleton = new Array();
     if(addWizard) {
-      arrOptSkeleton.push("\n\tprovides=c(\"logic\", \"dialog\", \"wizard\")");
+      arrOptSkeleton.push("\n\tprovides=c(\"logic\", \"dialog\", \"wizard\")"  );
     } else {
-      arrOptSkeleton.push("\n\t#provides=c(\"logic\", \"dialog\")");
+      arrOptSkeleton.push("\n\t#provides=c(\"logic\", \"dialog\")"  );
     }
     if(optPluginmap) {
-      arrOptSkeleton.push("\n\t" + optPluginmap);
+      arrOptSkeleton.push("\n\t" + optPluginmap  );
     } else {
-      arrOptSkeleton.push("\n\t#pluginmap=list(name=\"\", hierarchy=\"\", require=\"\")");
+      arrOptSkeleton.push("\n\t#pluginmap=list(name=\"\", hierarchy=\"\", require=\"\")"  );
     }
     if(addTests) {
-      arrOptSkeleton.push("\n\ttests=TRUE");
+      arrOptSkeleton.push("\n\ttests=TRUE"  );
     } else {
-      arrOptSkeleton.push("\n\ttests=FALSE");
+      arrOptSkeleton.push("\n\ttests=FALSE"  );
     }
     if(editPlugin) {
-      arrOptSkeleton.push("\n\tedit=TRUE");
+      arrOptSkeleton.push("\n\tedit=TRUE"  );
     } else {
-      arrOptSkeleton.push("\n\tedit=FALSE");
+      arrOptSkeleton.push("\n\tedit=FALSE"  );
     }
     if(addToConfig) {
-      arrOptSkeleton.push("\n\tload=TRUE");
+      arrOptSkeleton.push("\n\tload=TRUE"  );
     } else {
-      arrOptSkeleton.push("\n\tload=FALSE");
+      arrOptSkeleton.push("\n\tload=FALSE"  );
     }
     if(showPlugin) {
-      arrOptSkeleton.push("\n\tshow=TRUE");
+      arrOptSkeleton.push("\n\tshow=TRUE"  );
     } else {
-      arrOptSkeleton.push("\n\tshow=FALSE");
+      arrOptSkeleton.push("\n\tshow=FALSE"  );
     }
   // clean array arrOptSkeleton from empty strings
   arrOptSkeleton = arrOptSkeleton.filter(String);
@@ -216,7 +219,7 @@ function calculate(){
 
   echo("aboutPlugin <- rk.XML.about(");
   if(pluginName) {
-    echo("\n\tname=\"" + pluginName + "\"");
+    echo("\n\tname=\"" + pluginName + "\"");  
   } else {}
   var ocolOptcolAuthorGivenName = getList("optionsetAuthors.optcolAuthorGivenName");
   var ocolOptcolAuthorFamiliyName = getList("optionsetAuthors.optcolAuthorFamiliyName");
@@ -230,17 +233,17 @@ function calculate(){
     // define the array arrOptAuthorRole for values of R option "role"
     var arrOptAuthorRole = new Array();
         if(ocolOptcolAuthorAut[i] == 1) {
-            arrOptAuthorRole.push("\"aut\"");
+            arrOptAuthorRole.push("\"aut\""  );
         } else {
             arrOptAuthorRole.push();
         }
         if(ocolOptcolAuthorCre[i] == 1) {
-            arrOptAuthorRole.push("\"cre\"");
+            arrOptAuthorRole.push("\"cre\""  );
         } else {
             arrOptAuthorRole.push();
         }
         if(ocolOptcolAuthorCtb[i] == 1) {
-            arrOptAuthorRole.push("\"ctb\"");
+            arrOptAuthorRole.push("\"ctb\""  );
         } else {
             arrOptAuthorRole.push();
         }
@@ -256,13 +259,13 @@ function calculate(){
     echo("person(");
     echo("given=\"" + ocolOptcolAuthorGivenName[i] + "\"");
     if(ocolOptcolAuthorFamiliyName[i]) {
-        echo(", family=\"" + ocolOptcolAuthorFamiliyName[i] + "\"");
+      echo(", family=\"" + ocolOptcolAuthorFamiliyName[i] + "\"");  
     } else {}
     if(ocolOptcolAuthorMail[i]) {
-        echo(", email=\"" + ocolOptcolAuthorMail[i] + "\"");
+      echo(", email=\"" + ocolOptcolAuthorMail[i] + "\"");  
     } else {}
     if(optAuthorRole) {
-        echo(optAuthorRole);
+      echo(optAuthorRole);  
     } else {}
     echo(")");
     if(i + 1 < ocolOptcolAuthorGivenName.length) {
@@ -276,61 +279,61 @@ function calculate(){
   if(dependencyFrameChecked && (optDependencies || ocolOptcolPckgName)) {
     echo("plugin.dependencies <- rk.XML.dependencies(");
     if(optDependencies) {
-      echo(optDependencies);
+      echo(optDependencies);  
     } else {}
     if(optDependencies && ocolOptcolPckgName) {
-      echo(",");
+      echo(",");  
     } else {}
     if(ocolOptcolPckgName!= "") {
       echo("\n\tpackage=list(\n\t\t");
-  for (var i = 0; i < ocolOptcolPckgName.length; ++i){
-    echo("c(");
-    echo("name=\"" + ocolOptcolPckgName[i] + "\"");
-    if(ocolOptcolPckgMin[i]) {
-        echo(", min=\"" + ocolOptcolPckgMin[i] + "\"");
-    } else {}
-    if(ocolOptcolPckgMax[i]) {
-        echo(", max=\"" + ocolOptcolPckgMax[i] + "\"");
-    } else {}
-    if(ocolOptcolPckgRepo[i]) {
-        echo(", repository=\"" + ocolOptcolPckgRepo[i] + "\"");
-    } else {}
-    echo(")");
-    if(i + 1 < ocolOptcolPckgName.length) {
-      echo(",\n\t\t");
-    }
-  }
-  echo("\n\t)");
+      for (var i = 0; i < ocolOptcolPckgName.length; ++i){
+                        echo("c(");
+                        echo("name=\"" + ocolOptcolPckgName[i] + "\"");
+                        if(ocolOptcolPckgMin[i]) {
+          echo(", min=\"" + ocolOptcolPckgMin[i] + "\"");  
+        } else {}
+        if(ocolOptcolPckgMax[i]) {
+          echo(", max=\"" + ocolOptcolPckgMax[i] + "\"");  
+        } else {}
+        if(ocolOptcolPckgRepo[i]) {
+          echo(", repository=\"" + ocolOptcolPckgRepo[i] + "\"");  
+        } else {}
+                        echo(")");
+        if(i + 1 < ocolOptcolPckgName.length) {
+          echo(",\n\t\t");
+        }
+      }
+      echo("\n\t)");
     } else {}
     echo("\n)\n\n");
   } else {}
   echo("# name of the main component, relevant for help page content\nrk.set.comp(\"");
   if(menuName) {
-    echo(menuName + "\")\n\n");
+    echo(menuName + "\")\n\n");  
   } else {
-    echo(pluginName + "\")\n\n");
+    echo(pluginName + "\")\n\n");  
   }
   echo("############\n## your plugin dialog and JavaScript should be put here\n############\n\n");
   if(helpTextChecked) {
-    echo("############\n## help page\nplugin.summary <- rk.rkh.summary(\n\t");
+    echo("############\n## help page\nplugin.summary <- rk.rkh.summary(\n\t");  
     if(helpSummary) {
-      echo("\"" + helpSummary + "\"\n)");
+      echo("\"" + helpSummary + "\"\n)");  
     } else {
-      echo("\"" + pluginDescription + "\"\n)");
-    }
-    echo("\nplugin.usage <- rk.rkh.usage(\n\t\"" + helpUsage + "\"\n)\n\n");
+      echo("\"" + pluginDescription + "\"\n)");  
+    }  
+    echo("\nplugin.usage <- rk.rkh.usage(\n\t\"" + helpUsage + "\"\n)\n\n");  
   } else {}
   echo("#############\n" + "## the main call\n" + "## if you run the following function call, files will be written to output.dir!\n" + "#############\n" + "# this is where things get serious, that is, here all of the above is put together into one plugin\n" + "plugin.dir <- rk.plugin.skeleton(\n\tabout=aboutPlugin,");
   if(dependencyFrameChecked && optDependencies) {
-    echo("\n\tdependencies=plugin.dependencies,");
+    echo("\n\tdependencies=plugin.dependencies,");  
   } else {
-    echo("\n\t#dependencies=plugin.dependencies,");
+    echo("\n\t#dependencies=plugin.dependencies,");  
   }
   echo("\n\tpath=output.dir," + "\n\tguess.getter=guess.getter," + "\n\tscan=c(\"var\", \"saveobj\", \"settings\")," + "\n\txml=list(\n\t\t#dialog=,\n\t\t#wizard=,\n\t\t#logic=,\n\t\t#snippets=\n\t)," + "\n\tjs=list(\n\t\t#results.header=FALSE,\n\t\t#load.silencer=,\n\t\t#require=,\n\t\t#variables=," + "\n\t\t#globals=,\n\t\t#preprocess=,\n\t\t#calculate=,\n\t\t#printout=,\n\t\t#doPrintout=\n\t),");
   if(helpTextChecked) {
-    echo("\n\trkh=list(\n\t\tsummary=plugin.summary,\n\t\tusage=plugin.usage#," + "\n\t\t#sections=,\n\t\t#settings=,\n\t\t#related=,\n\t\t#technical=\n\t)," + "\n\tcreate=c(\"pmap\", \"xml\", \"js\", \"desc\", \"rkh\"),");
+    echo("\n\trkh=list(\n\t\tsummary=plugin.summary,\n\t\tusage=plugin.usage#," + "\n\t\t#sections=,\n\t\t#settings=,\n\t\t#related=,\n\t\t#technical=\n\t)," + "\n\tcreate=c(\"pmap\", \"xml\", \"js\", \"desc\", \"rkh\"),");  
   } else {
-    echo("\n\trkh=list(" + "\n\t\t#summary=,\n\t\t#usage=," + "\n\t\t#sections=,\n\t\t#settings=,\n\t\t#related=,\n\t\t#technical=\n\t)," + "\n\tcreate=c(\"pmap\", \"xml\", \"js\", \"desc\"),");
+    echo("\n\trkh=list(" + "\n\t\t#summary=,\n\t\t#usage=," + "\n\t\t#sections=,\n\t\t#settings=,\n\t\t#related=,\n\t\t#technical=\n\t)," + "\n\tcreate=c(\"pmap\", \"xml\", \"js\", \"desc\"),");  
   }
   echo("\n\toverwrite=overwrite,");
   echo("\n\t#components=list(),");
diff --git a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh
index bdf8156..2eb3a83 100644
--- a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh
+++ b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh
@@ -1,5 +1,9 @@
 <!DOCTYPE rkhelp >
 <document>
+  <!-- this code was generated using the rkwarddev package.
+    perhaps don't make changes here, but in the rkwarddev script instead!
+    
+    look for a file called: $SRC/demo/skeleton_dialog.R -->
   <title>
     Create RKWard plugin skeleton
   </title>
@@ -8,11 +12,11 @@
   </summary>
   <usage>
     This plugin is both, an example for a plugin written with the rkwarddev package,
-     and a quick way to get a skeleton for new plugins.
+   and a quick way to get a skeleton for new plugins.
   </usage>
-  <!--   <section id="sct_EDITORDE" title="EDIT OR DELETE ME">
-          EDIT OR DELETE ME
-        </section> -->
+  <!-- <section id="sct_EDITORDE" title="EDIT OR DELETE ME">
+        EDIT OR DELETE ME
+      </section> -->
   <settings>
     <caption id="tab_Abtthplg" />
     <caption id="aboutPlugin" />
@@ -78,7 +82,7 @@
     </setting>
     <setting id="addToConfig">
       If this is checkend, the generated plugin will automatically be registered in RKWard's configuration.
-                  If you store it in a temporary directory and remove it before the next start of RKWard, the entry will removed again as well.
+              If you store it in a temporary directory and remove it before the next start of RKWard, the entry will removed again as well.
     </setting>
     <setting id="showPlugin">
       If this is checked, the generated plugin will be shown (opened) for you to see what it looks like.
@@ -130,13 +134,13 @@
       A general note on how to use the plugin.
     </setting>
   </settings>
-  <!--   <related>
-          <ul>
-            <li>
-              <link href="rkward://rhelp/..." />
-            </li>
-          </ul>
-        </related> -->
+  <!-- <related>
+        <ul>
+          <li>
+            <link href="rkward://rhelp/..." />
+          </li>
+        </ul>
+      </related> -->
   <technical>
   </technical>
 </document>
diff --git a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml
index a978877..f2ae6aa 100644
--- a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml
+++ b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml
@@ -1,9 +1,13 @@
 <!DOCTYPE rkplugin >
 <document>
+  <!-- this code was generated using the rkwarddev package.
+    perhaps don't make changes here, but in the rkwarddev script instead!
+    
+    look for a file called: $SRC/demo/skeleton_dialog.R -->
   <code file="CreateRKWardpluginskeleton.js" />
   <help file="CreateRKWardpluginskeleton.rkh" />
-  <!--   <dependencies>
-        </dependencies> -->
+  <!-- <dependencies>
+      </dependencies> -->
   <logic>
     <connect governor="dependencyFrame.checked" client="RKFrame.enabled" />
     <connect governor="dependencyFrame.checked" client="RFrame.enabled" />



More information about the rkward-tracker mailing list