[rkward-cvs] SF.net SVN: rkward-code:[4798] trunk/rkward/packages/rkwarddev
m-eik at users.sf.net
m-eik at users.sf.net
Mon Sep 1 13:31:29 UTC 2014
Revision: 4798
http://sourceforge.net/p/rkward/code/4798
Author: m-eik
Date: 2014-09-01 13:31:28 +0000 (Mon, 01 Sep 2014)
Log Message:
-----------
added inital support for static internationalisation of plugins (see docs for rk.set.language(), rk.get.language() and i18n()); regenerated docs using roxygen2 4.x
Modified Paths:
--------------
trunk/rkward/packages/rkwarddev/ChangeLog
trunk/rkward/packages/rkwarddev/DESCRIPTION
trunk/rkward/packages/rkwarddev/NAMESPACE
trunk/rkward/packages/rkwarddev/R/rk-internal.R
trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
trunk/rkward/packages/rkwarddev/debian/changelog
trunk/rkward/packages/rkwarddev/debian/control
trunk/rkward/packages/rkwarddev/debian/copyright
trunk/rkward/packages/rkwarddev/debian/rules
trunk/rkward/packages/rkwarddev/inst/CITATION
trunk/rkward/packages/rkwarddev/inst/NEWS.Rd
trunk/rkward/packages/rkwarddev/man/echo.Rd
trunk/rkward/packages/rkwarddev/man/id.Rd
trunk/rkward/packages/rkwarddev/man/ite.Rd
trunk/rkward/packages/rkwarddev/man/join.Rd
trunk/rkward/packages/rkwarddev/man/qp.Rd
trunk/rkward/packages/rkwarddev/man/rk.JS.array.Rd
trunk/rkward/packages/rkwarddev/man/rk.JS.doc.Rd
trunk/rkward/packages/rkwarddev/man/rk.JS.options.Rd
trunk/rkward/packages/rkwarddev/man/rk.JS.saveobj.Rd
trunk/rkward/packages/rkwarddev/man/rk.JS.scan.Rd
trunk/rkward/packages/rkwarddev/man/rk.JS.vars.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.about.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.attribute.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.browser.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.cbox.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.code.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.col.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.component.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.components.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.connect.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.context.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.convert.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.copy.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.dependencies.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.dependency_check.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.dialog.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.dropdown.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.embed.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.entry.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.external.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.formula.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.frame.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.help.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.hierarchy.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.include.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.input.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.insert.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.logic.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.matrix.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.menu.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.optioncolumn.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.optiondisplay.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.optionset.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.page.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.plugin.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.pluginmap.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.preview.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.radio.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.require.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.row.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.saveobj.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.set.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.snippet.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.snippets.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.spinbox.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.stretch.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.switch.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.tabbook.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.text.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.vars.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.varselector.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.varslot.Rd
trunk/rkward/packages/rkwarddev/man/rk.XML.wizard.Rd
trunk/rkward/packages/rkwarddev/man/rk.build.plugin.Rd
trunk/rkward/packages/rkwarddev/man/rk.comment.Rd
trunk/rkward/packages/rkwarddev/man/rk.paste.JS.Rd
trunk/rkward/packages/rkwarddev/man/rk.paste.JS.graph.Rd
trunk/rkward/packages/rkwarddev/man/rk.plotOptions.Rd
trunk/rkward/packages/rkwarddev/man/rk.plugin.component.Rd
trunk/rkward/packages/rkwarddev/man/rk.plugin.skeleton.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.caption.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.doc.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.link.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.related.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.scan.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.section.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.setting.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.settings.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.summary.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.technical.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.title.Rd
trunk/rkward/packages/rkwarddev/man/rk.rkh.usage.Rd
trunk/rkward/packages/rkwarddev/man/rk.testsuite.doc.Rd
trunk/rkward/packages/rkwarddev/man/rk.uniqueIDs.Rd
trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
trunk/rkward/packages/rkwarddev/man/show-methods.Rd
trunk/rkward/packages/rkwarddev/man/tf.Rd
Added Paths:
-----------
trunk/rkward/packages/rkwarddev/R/i18n.R
trunk/rkward/packages/rkwarddev/R/rk.get.language.R
trunk/rkward/packages/rkwarddev/R/rk.set.language.R
trunk/rkward/packages/rkwarddev/inst/doc/
trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode.png
trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode_JS.png
trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.Rnw
trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
trunk/rkward/packages/rkwarddev/man/i18n.Rd
trunk/rkward/packages/rkwarddev/man/rk.get.language.Rd
trunk/rkward/packages/rkwarddev/man/rk.set.language.Rd
Removed Paths:
-------------
trunk/rkward/packages/rkwarddev/vignettes/rkwarddev_vignette.pdf
Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/ChangeLog 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,5 +1,13 @@
ChangeLog for package rkwarddev
+changes in version 0.06-4 (2014-09-01)
+added:
+ - new functions rk.set.language(), rk.get.language() and i18n() to facilitate
+ static internationalisation of plugins; makes use of a new internal environment
+ .rkdev.env
+fixed:
+ - abbreviation of labels now limits valid characters to [0-9A-Za-z]
+
changes in version 0.06-3 (2013-12-21)
fixed:
- fixed outdated example code for rk.plugin.component()
Modified: trunk/rkward/packages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/packages/rkwarddev/DESCRIPTION 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/DESCRIPTION 2014-09-01 13:31:28 UTC (rev 4798)
@@ -14,20 +14,20 @@
URL: http://rkward.sourceforge.net
Authors at R: c(person(given="Meik", family="Michalke",
email="meik.michalke at hhu.de", role=c("aut", "cre")))
-Version: 0.06-3
-Date: 2013-12-21
+Version: 0.06-4
+Date: 2014-09-01
Collate:
'echo.R'
+ 'i18n.R'
'id.R'
'rk.JS.ite-class.R'
'ite.R'
'join.R'
'qp.R'
- 'rk.build.plugin.R'
'rk.comment.R'
'rk-internal.R'
+ 'rk.JS.arr-class.R'
'rk.JS.array.R'
- 'rk.JS.arr-class.R'
'rk.JS.doc.R'
'rk.JS.opt-class.R'
'rk.JS.options.R'
@@ -35,29 +35,6 @@
'rk.JS.scan.R'
'rk.JS.var-class.R'
'rk.JS.vars.R'
- 'rk.paste.JS.graph.R'
- 'rk.paste.JS.R'
- 'rk.plotOptions.R'
- 'rk.rkh.doc.R'
- 'rk.XML.plugin.R'
- 'rk.plug.comp-class.R'
- 'rk.plugin.component.R'
- 'rk.plugin.skeleton.R'
- 'rk.rkh.caption.R'
- 'rk.rkh.link.R'
- 'rk.rkh.related.R'
- 'rk.rkh.scan.R'
- 'rk.rkh.section.R'
- 'rk.rkh.setting.R'
- 'rk.rkh.settings.R'
- 'rk.rkh.summary.R'
- 'rk.rkh.technical.R'
- 'rk.rkh.title.R'
- 'rk.rkh.usage.R'
- 'rk.testsuite.doc.R'
- 'rk.uniqueIDs.R'
- 'rkwarddev-desc-internal.R'
- 'rkwarddev-package.R'
'rk.XML.about.R'
'rk.XML.attribute.R'
'rk.XML.browser.R'
@@ -91,6 +68,7 @@
'rk.XML.optiondisplay.R'
'rk.XML.optionset.R'
'rk.XML.page.R'
+ 'rk.XML.plugin.R'
'rk.XML.pluginmap.R'
'rk.XML.preview.R'
'rk.XML.radio.R'
@@ -105,10 +83,35 @@
'rk.XML.switch.R'
'rk.XML.tabbook.R'
'rk.XML.text.R'
+ 'rk.XML.vars.R'
'rk.XML.varselector.R'
'rk.XML.varslot.R'
- 'rk.XML.vars.R'
'rk.XML.wizard.R'
+ 'rk.build.plugin.R'
+ 'rk.get.language.R'
+ 'rk.paste.JS.R'
+ 'rk.paste.JS.graph.R'
+ 'rk.plotOptions.R'
+ 'rk.rkh.doc.R'
+ 'rk.plug.comp-class.R'
+ 'rk.plugin.component.R'
+ 'rk.plugin.skeleton.R'
+ 'rk.rkh.caption.R'
+ 'rk.rkh.link.R'
+ 'rk.rkh.related.R'
+ 'rk.rkh.scan.R'
+ 'rk.rkh.section.R'
+ 'rk.rkh.setting.R'
+ 'rk.rkh.settings.R'
+ 'rk.rkh.summary.R'
+ 'rk.rkh.technical.R'
+ 'rk.rkh.title.R'
+ 'rk.rkh.usage.R'
+ 'rk.set.language.R'
+ 'rk.testsuite.doc.R'
+ 'rk.uniqueIDs.R'
+ 'rkwarddev-desc-internal.R'
+ 'rkwarddev-package.R'
'show-methods.R'
'tf.R'
'zzz.rk.plot.opts-class.R'
Modified: trunk/rkward/packages/rkwarddev/NAMESPACE
===================================================================
--- trunk/rkward/packages/rkwarddev/NAMESPACE 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/NAMESPACE 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,41 +1,17 @@
-exportClasses(rk.JS.arr)
-exportClasses(rk.JS.ite)
-exportClasses(rk.JS.opt)
-exportClasses(rk.JS.var)
-exportClasses(rk.plot.opts)
-exportClasses(rk.plug.comp)
+# Generated by roxygen2 (4.0.1): do not edit by hand
+
export(echo)
+export(i18n)
export(id)
export(ite)
export(join)
-exportMethods(show)
export(qp)
-export(rk.build.plugin)
-export(rk.comment)
export(rk.JS.array)
export(rk.JS.doc)
export(rk.JS.options)
export(rk.JS.saveobj)
export(rk.JS.scan)
export(rk.JS.vars)
-export(rk.paste.JS)
-export(rk.paste.JS.graph)
-export(rk.plotOptions)
-export(rk.plugin.component)
-export(rk.plugin.skeleton)
-export(rk.rkh.caption)
-export(rk.rkh.doc)
-export(rk.rkh.link)
-export(rk.rkh.related)
-export(rk.rkh.scan)
-export(rk.rkh.section)
-export(rk.rkh.setting)
-export(rk.rkh.settings)
-export(rk.rkh.summary)
-export(rk.rkh.technical)
-export(rk.rkh.title)
-export(rk.rkh.usage)
-export(rk.testsuite.doc)
export(rk.XML.about)
export(rk.XML.attribute)
export(rk.XML.browser)
@@ -89,5 +65,34 @@
export(rk.XML.varselector)
export(rk.XML.varslot)
export(rk.XML.wizard)
+export(rk.build.plugin)
+export(rk.comment)
+export(rk.get.language)
+export(rk.paste.JS)
+export(rk.paste.JS.graph)
+export(rk.plotOptions)
+export(rk.plugin.component)
+export(rk.plugin.skeleton)
+export(rk.rkh.caption)
+export(rk.rkh.doc)
+export(rk.rkh.link)
+export(rk.rkh.related)
+export(rk.rkh.scan)
+export(rk.rkh.section)
+export(rk.rkh.setting)
+export(rk.rkh.settings)
+export(rk.rkh.summary)
+export(rk.rkh.technical)
+export(rk.rkh.title)
+export(rk.rkh.usage)
+export(rk.set.language)
+export(rk.testsuite.doc)
export(tf)
+exportClasses(rk.JS.arr)
+exportClasses(rk.JS.ite)
+exportClasses(rk.JS.opt)
+exportClasses(rk.JS.var)
+exportClasses(rk.plot.opts)
+exportClasses(rk.plug.comp)
+exportMethods(show)
import(methods)
Added: trunk/rkward/packages/rkwarddev/R/i18n.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/i18n.R (rev 0)
+++ trunk/rkward/packages/rkwarddev/R/i18n.R 2014-09-01 13:31:28 UTC (rev 4798)
@@ -0,0 +1,58 @@
+# Copyright 2010-2014 Meik Michalke <meik.michalke at hhu.de>
+#
+# This file is part of the R package rkwarddev.
+#
+# rkwarddev is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# rkwarddev is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with rkwarddev. If not, see <http://www.gnu.org/licenses/>.
+
+
+#' Translate parts of a plugin
+#'
+#' Takes a list of entries named after abbreviated languages, and returns
+#' either the one matching the language set with \code{\link[rkwarddev:rk.set.language]{rk.set.language}},
+#' or the first entry if no language was set at all or the set language cannot be found in
+#' \code{...}.
+#'
+#' If used in an \code{rkwarddev} script, this can be used to toggle the generation of plugins
+#' in a certain language.
+#'
+#' @param ... Comma separated, named elements, see description.
+#' @param lang Character string, the language to return.
+#' @export
+#' @examples
+#' rk.set.language("en", c("en_EN", "en_US"))
+#' (var.select <- rk.XML.varselector(label=i18n(en="Select data", de="Wähle Daten")))
+#'
+#' # now try the same with the alternate language
+#' rk.set.language("de", "de_DE")
+#' (var.select <- rk.XML.varselector(label=i18n(en="Select data", de="Wähle Daten")))
+
+i18n <- function(..., lang=rk.get.language()){
+ obj <- list(...)
+ # check if any language is set at all
+ if(is.null(lang)){
+ # if not, simply return the first entry as the default
+ warning("i18n() was called, but no language is set, using default values!")
+ return(obj[[1]])
+ } else {
+ # there is a language set, but is there also a translation
+ # given for that language?
+ if(lang %in% names(obj)){
+ return(obj[[lang]])
+ } else {
+ # if not, again fall back to the first entry as default
+ warning(paste("i18n() was called, but no translation into", dQuote(lang), "was found, using default values!"))
+ return(obj[[1]])
+ }
+ }
+}
Modified: trunk/rkward/packages/rkwarddev/R/rk-internal.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk-internal.R 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/R/rk-internal.R 2014-09-01 13:31:28 UTC (rev 4798)
@@ -15,7 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with rkwarddev. If not, see <http://www.gnu.org/licenses/>.
+# collate voodoo
+#' @include rk.comment.R
+# set up an internal environment, e.g. for language settings
+.rkdev.env <- new.env()
+
# internal functions for the rk.* functions
## wrapper for paste0() needed?
@@ -33,7 +38,7 @@
## function auto.ids()
auto.ids <- function(identifiers, prefix=NULL, suffix=NULL, chars=8){
- identifiers <- gsub("[[:space:]]*[^[:alnum:]]*", "", identifiers)
+ identifiers <- gsub("[[:space:]]*[^[0-9A-Za-z]]*", "", identifiers)
id.names <- ifelse(nchar(identifiers) > 8, abbreviate(identifiers, minlength=chars), identifiers)
# check for uniqueness
if(any(duplicated(id.names))){
Added: trunk/rkward/packages/rkwarddev/R/rk.get.language.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.get.language.R (rev 0)
+++ trunk/rkward/packages/rkwarddev/R/rk.get.language.R 2014-09-01 13:31:28 UTC (rev 4798)
@@ -0,0 +1,40 @@
+# Copyright 2010-2014 Meik Michalke <meik.michalke at hhu.de>
+#
+# This file is part of the R package rkwarddev.
+#
+# rkwarddev is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# rkwarddev is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with rkwarddev. If not, see <http://www.gnu.org/licenses/>.
+
+
+#' Get plugin language for internationalisation
+#'
+#' @param locales Logical, whether to query for language or locales set.
+#' @export
+#' @examples
+#' rk.get.language()
+
+rk.get.language <- function(locales=FALSE){
+ if(isTRUE(locales)){
+ if(exists("locales", envir=.rkdev.env, inherits=FALSE)){
+ locales <- get("locales", envir=.rkdev.env)
+ return(locales)
+ } else {}
+ } else {
+ if(exists("lang", envir=.rkdev.env, inherits=FALSE)){
+ lang <- get("lang", envir=.rkdev.env)
+ return(lang)
+ } else {
+ return(invisible(NULL))
+ }
+ }
+}
Added: trunk/rkward/packages/rkwarddev/R/rk.set.language.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.set.language.R (rev 0)
+++ trunk/rkward/packages/rkwarddev/R/rk.set.language.R 2014-09-01 13:31:28 UTC (rev 4798)
@@ -0,0 +1,49 @@
+# Copyright 2010-2014 Meik Michalke <meik.michalke at hhu.de>
+#
+# This file is part of the R package rkwarddev.
+#
+# rkwarddev is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# rkwarddev is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with rkwarddev. If not, see <http://www.gnu.org/licenses/>.
+
+#' Set plugin language for internationalisation
+#'
+#' Stores the given language in an internal environment, so functions like
+#' \code{\link[rkwarddev:i18n]{i18n}} can use it.
+#'
+#' @param lang Character string, abbreviated language to use with \code{\link[rkwarddev:i18n]{i18n}}, e.g. \code{"en"}.
+#' @param locales Character vector, all the locales this translation covers, e.g. \code{c("en_EN", "en_US")}.
+#' @export
+#' @examples
+#' rk.set.language("en", c("en_EN", "en_US"))
+
+rk.set.language <- function(lang=NULL, locales=NULL){
+ if(is.null(lang)){
+ if(exists("lang", envir=.rkdev.env, inherits=FALSE)){
+ rm("lang", envir=.rkdev.env)
+ } else {}
+ if(exists("locales", envir=.rkdev.env, inherits=FALSE)){
+ rm("locales", envir=.rkdev.env)
+ } else {}
+ message(paste("removed language setting"))
+ } else {
+ assign("lang", lang, envir=.rkdev.env)
+ message(paste("set language to:", dQuote(lang)))
+ if(is.null(locales)){
+ warning("please provide at least one locale!")
+ } else {
+ assign("locales", locales, envir=.rkdev.env)
+ message(paste("set locales to:", paste0(dQuote(locales), collapse=", ")))
+ }
+ }
+ return(invisible(NULL))
+}
Modified: trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,28 +1,10 @@
-# Copyright 2010-2014 Meik Michalke <meik.michalke at hhu.de>
-#
-# This file is part of the R package rkwarddev.
-#
-# rkwarddev is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# rkwarddev is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with rkwarddev. If not, see <http://www.gnu.org/licenses/>.
-
-
#' A collection of tools for RKWard plugin development.
#'
#' \tabular{ll}{
#' Package: \tab rkwarddev\cr
#' Type: \tab Package\cr
-#' Version: \tab 0.06-3\cr
-#' Date: \tab 2013-12-21\cr
+#' Version: \tab 0.06-4\cr
+#' Date: \tab 2014-09-01\cr
#' Depends: \tab R (>= 2.9.0),methods,XiMpLe (>= 0.03-21),rkward (>= 0.5.7)\cr
#' Enhances: \tab rkward\cr
#' Encoding: \tab UTF-8\cr
Modified: trunk/rkward/packages/rkwarddev/debian/changelog
===================================================================
--- trunk/rkward/packages/rkwarddev/debian/changelog 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/debian/changelog 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,9 @@
+r-other-rkward-rkwarddev (0.06-4-1) unstable; urgency=low
+
+ * new upstream release
+
+ -- m.eik michalke <meik.michalke at hhu.de> Mon, 01 Sep 2014 15:04:59 +0200
+
r-other-rkward-rkwarddev (0.06-3-1) unstable; urgency=low
* new upstream release
Modified: trunk/rkward/packages/rkwarddev/debian/control
===================================================================
--- trunk/rkward/packages/rkwarddev/debian/control 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/debian/control 2014-09-01 13:31:28 UTC (rev 4798)
@@ -2,7 +2,7 @@
Section: math
Priority: optional
Maintainer: m.eik michalke <meik.michalke at hhu.de>
-Build-Depends-Indep: debhelper (>> 4.1.0), r-base-dev (>= 2.9.0), cdbs, r-cran-ximple (>= 0.03-21) | r-other-reaktanz-ximple (>=
+Build-Depends-Indep: debhelper (>> 7.0.0), r-base-dev (>= 3.0.0), cdbs, r-cran-ximple (>= 0.03-21) | r-other-reaktanz-ximple (>=
0.03-21) | r-other-rkward-ximple (>= 0.03-21), rkward (>= 0.5.7)
Standards-Version: 3.9.3.1
Homepage: http://rkward.sourceforge.net
Modified: trunk/rkward/packages/rkwarddev/debian/copyright
===================================================================
--- trunk/rkward/packages/rkwarddev/debian/copyright 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/debian/copyright 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,12 +1,12 @@
-The R library rkwarddev was originally written and is maintained by Meik Michalke <meik.michalke at hhu.de>.
+The R library rkwarddev was originally written and is maintained by Meik Michalke <meik.michalke at hhu.de>.
-This Debian package was put together m.eik michalke <meik.michalke at hhu.de>.
+This Debian package was put together by m.eik michalke <meik.michalke at hhu.de>.
The package was renamed from its upstream name 'rkwarddev' to
'r-other-rkward-rkwarddev' in harmony with the R packaging policy to indicate
that the package is external to the CRAN or BioC repositories.
-rkwarddev Copyright (C) 2013 Meik Michalke, released under the
+rkwarddev Copyright (C) 2014 Meik Michalke, released under the
GNU General Public License (GPL) version 3 or (at your option) any later version.
This software is distributed in the hope that it will be useful, but
Modified: trunk/rkward/packages/rkwarddev/debian/rules
===================================================================
--- trunk/rkward/packages/rkwarddev/debian/rules 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/debian/rules 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file for the Debian/GNU Linux r-other-rkward-rkwarddev package
-# Copyright 2013 by m.eik michalke <meik.michalke at hhu.de>
+# Copyright 2014 by m.eik michalke <meik.michalke at hhu.de>
debRreposname := other-rkward
Modified: trunk/rkward/packages/rkwarddev/inst/CITATION
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/CITATION 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/inst/CITATION 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,14 +1,14 @@
bibentry("Manual",
- title="rkwarddev: A collection of tools for RKWard plugin development",
- author="Meik Michalke",
- year="2013",
- note="(Version 0.06-3)",
- url="http://rkward.sourceforge.net",
+ title="rkwarddev: A collection of tools for RKWard plugin development",
+ author="Meik Michalke",
+ year="2014",
+ note="(Version 0.06-4)",
+ url="http://rkward.sourceforge.net",
- textVersion =
- paste("Michalke, M. (2013). ",
- "rkwarddev: A collection of tools for RKWard plugin development (Version 0.06-3). ",
- "Available from http://rkward.sourceforge.net",
- sep=""),
+ textVersion =
+ paste("Michalke, M. (2014). ",
+ "rkwarddev: A collection of tools for RKWard plugin development (Version 0.06-4). ",
+ "Available from http://rkward.sourceforge.net",
+ sep=""),
- mheader = "To cite rkwarddev in publications use:")
+ mheader = "To cite rkwarddev in publications use:")
Modified: trunk/rkward/packages/rkwarddev/inst/NEWS.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/NEWS.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/inst/NEWS.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,6 +1,20 @@
\name{NEWS}
\title{News for Package 'rkwarddev'}
\encoding{UTF-8}
+\section{Changes in rkwarddev version 0.06-4 (2014-09-01)}{
+ \subsection{added}{
+ \itemize{
+ \item new functions \code{rk.set.language()}, \code{rk.get.language()} and \code{i18n()} to facilitate
+ static internationalisation of plugins; makes use of a new internal environment
+ .rkdev.env
+ }
+ }
+ \subsection{fixed}{
+ \itemize{
+ \item abbreviation of labels now limits valid characters to [0-9A-Za-z]
+ }
+ }
+}
\section{Changes in rkwarddev version 0.06-3 (2013-12-21)}{
\subsection{fixed}{
\itemize{
Added: trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode.png
===================================================================
(Binary files differ)
Index: trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode.png
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode.png 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode.png 2014-09-01 13:31:28 UTC (rev 4798)
Property changes on: trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode_JS.png
===================================================================
(Binary files differ)
Index: trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode_JS.png
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode_JS.png 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode_JS.png 2014-09-01 13:31:28 UTC (rev 4798)
Property changes on: trunk/rkward/packages/rkwarddev/inst/doc/RKWard_vign_example_dialog_wcode_JS.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.Rnw
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.Rnw (rev 0)
+++ trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.Rnw 2014-09-01 13:31:28 UTC (rev 4798)
@@ -0,0 +1,512 @@
+\documentclass[a4paper,10pt]{scrartcl}
+\usepackage[utf8x]{inputenc}
+\usepackage{apacite}
+
+%opening
+\title{RKWard plugin development with the \texttt{rkwarddev} package}
+%\VignetteIndexEntry{RKWard plugin development with the rkwarddev package}
+\author{m.eik michalke}
+
+\begin{document}
+
+\maketitle
+
+\begin{abstract}
+Writing plugins for \texttt{RKWard} means writing at least two XML files (a GUI description and a plugin map),
+one JavaScript file (to create the \texttt{R} code), maybe a help file (again in XML), and for plugins who
+should be distributed, a DESCRIPTION file. Furtermore, all of these files need to be in a certain directory
+structure.
+
+The \texttt{rkwarddev} package aims to simplify this, by enabling you to fulfill all the listed tasks in just
+one \texttt{R} script.
+\end{abstract}
+
+\section{About the package}
+You might ask why you should write R scripts to generate plugins, if you could just directly write the XML
+and JavaScript files. First of all, you don't have to use this package at all, it's totally fine to code your
+plugins how ever you like. The main reason why I wrote this package is that I like to really concentrate on
+what I'm doing, so this is my attempt to avoid the need to switch between several files in three different languages all the
+time. I wanted to be able to constantly ''think in \texttt{R}`` while working on a plugin, and to oversee everything
+that matters in one script. As a side effect, a lot of useful automation was implemented, so using this package
+will definitely save you quite some amount of typing.
+
+\section{Before we start}
+It is important to understand that while \texttt{rkwarddev} can help you to make designing new plugins
+much easier, you still need to know how the generated XML and JavaScript files work and interact. That is, if
+you didn't yet read the \textit{Introduction to Writing Plugins for
+RKWard},\footnote{\url{http://rkward.sourceforge.net/documents/devel/plugins/index.html}} please do so before
+you start working with this package. Once you're sure you understand how plugins in \texttt{RKWard} actually
+work, just come back here.
+
+\section{Ingredients}
+If you look at the contents of the package, you might feel a little lost because of the number of functions.
+So let's first see that there's actually some order in the chaos.
+
+Most functions start with the prefix \texttt{rk.} to indicate that they somehow belong to \texttt{RKWard}
+(we'll get to the exceptions later). After that, many names have another abbreviation by which they can
+roughly be classified into their specific ''area`` of plugin development:
+
+\begin{itemize}
+ \item \texttt{rk.XML.*()}: XML code for GUI description (and plugin maps)
+ \item \texttt{rk.JS.*()}: JavaScript code
+ \item \texttt{rk.rkh.*()}: XML code for help pages
+\end{itemize}
+
+In short, you should find a \texttt{rk.XML.*()} equivalent to every XML tag explained in the
+\textit{Introduction to Writing Plugins for
+RKWard},\footnote{\url{http://rkward.sourceforge.net/documents/devel/plugins/index.html}}
+e.\,g. \texttt{rk.XML.dropdown()} to generate a \texttt{<dropdown>} menu node. There are a few functions for
+JavaScript generation which fall out of this scheme. That is because firstly they should be intuitively to use
+just like their JavaScript equivalent (like \texttt{echo()}), and secondly they are likely to be used very often
+in a script, so short names seemed to be a blessing here (like \texttt{id()} or \texttt{tf()}).
+
+Adding to that, there are some special functions, which will all be explained later, but here's the list,
+roughly ordered by the development stage they're used for:
+
+\begin{itemize}
+ \item \texttt{rk.paste.JS()}: Paste JavaScript code from \texttt{rkwarddev} objects
+ \item \texttt{rk.XML.plugin()}: Combine XML objects into one plugin GUI object
+ \item \texttt{rk.JS.scan()}: Scan a GUI XML file (or \texttt{rkwarddev} object) and generate JavaScript code
+ (define all relevant variables)
+ \item \texttt{rk.JS.saveobj()}: Scan a GUI XML file (or \texttt{rkwarddev} object) and generate JavaScript code
+ (save result objects)
+ \item \texttt{rk.JS.doc()}: Combine JavaScript parts into one plugin JavaScript file object
+ \item \texttt{rk.rkh.scan()}: Scan a GUI XML file (or \texttt{rkwarddev} object) and generate a help page skeleton
+ \item \texttt{rk.rkh.doc()}: Combine XML objects into one help page object
+ \item \texttt{rk.plugin.component()}: Combine XML, JavaScript and help file objects into one plugin component object
+ (i.\,e. one dialog, so \textit{one} plugin can provide \textit{several} dialogs in one package)
+ \item \texttt{rk.testsuite.doc()}: Paste a testsuite skeleton
+ \item \texttt{rk.XML.pluginmap()}: Combine XML objects into one plugin map object
+ \item \texttt{rk.plugin.skeleton()}: Generate actual plugin files from the component,
+ testsuite and plugin map objects (i.\,e., put all of the above together)
+ \item \texttt{rk.build.plugin()}: Compress the generated files into an installable \texttt{R} package for
+ distribution
+\end{itemize}
+
+\subsection{Exceptions to the rule}
+As said before, there are some functions that fall out of the explained name scheme,i.\,e. they don't start with
+\texttt{rk.<XML|JS|rkh>.*()}. They are all relevant for the generation of JavaScript code, and this is just a short overview,
+how you use them will also be explained later on:
+
+\begin{itemize}
+ \item \texttt{echo()}: Produces an equivalent of the JavaScript \texttt{echo()} function
+ \item \texttt{id()}: Similar to paste, but replaces \texttt{rkwarddev} objects with their ID value
+ \item \texttt{ite()}: Short for ''\textbf{i}f, \textbf{t}hen, \textbf{e}lse``, a shortcut to generate JavaScript \texttt{if() \{\} else \{\}} conditions
+ \item \texttt{qp()}: Short for ''\textbf{q}uote \& \textbf{p}lus``, like \texttt{id()}, but with different replacement defaults
+ \item \texttt{tf()}: Short for ''\textbf{t}rue/\textbf{f}alse``, a shortcut to \texttt{ite()} for XML checkbox objects
+ \item \texttt{rk.comment()}: Creates a comment object to show up in the generated code -- works for both XML and JavaScript generation
+\end{itemize}
+
+
+\section{Writing a plugin}
+The previously mentioned \textit{Introduction to Writing Plugins for RKWard}\footnote{\url{http://rkward.sourceforge.net/documents/devel/plugins/index.html}}
+has a chapter on \texttt{rkwarddev} as well, which also includes a full example plugin already. This section will not so much repeat what you can learn there,
+but rather explain the basic steps to create a plugin ''the \texttt{rkwarddev} way`` in general. While doing that, we'll explore some of the alternative options
+you have when using different functions.
+
+Some of them might not be so obvious at first, but I believe that once you know them, you'll learn to like them, too. The basic steps to write a plugin using this
+package can be summarized this way:
+
+\begin{enumerate}
+ \item Know how the \texttt{R} code works you want to generate with the plugin in the end
+ \item Have an idea what the dialog should look like (e.\,g., a varselector left, a varslot and two checkboxes right, etc.)
+ \item Use \texttt{rkwarddev} functions to
+ \begin{enumerate}
+ \item create XML objects for each of these dialog elements individually
+ \item combine these individual objects to one dialog object
+ \item create JavaScript objects (using the XML objects) responsible for the \texttt{R} code of the finished plugin
+ \item create logic, wizard, ... objects the same way
+ \begin{itemize}
+ \item maybe also create help files objects
+ \end{itemize}
+ \item combine all the dialog, logic, wizard, JavaScript ... objects into one plugin and have it written to disk (the plugin map will be generated almost by itself)
+ \end{enumerate}
+\end{enumerate}
+
+So you start with individual parts (the widget elements), combine them, combine what you combined, and so forth.
+
+To begin with some background info, this package makes use of another \texttt{R} package I wrote, called
+\texttt{XiMpLe}\footnote{\url{http://reaktanz.de/?c=hacking\&s=XiMpLe}}. It is a \textit{very} simple XML parser/generator, hence its name.
+All \texttt{rkwarddev} functions dealing with XML utilize tools of this package, that is, the XML objects created are most likely of class
+\texttt{XiMpLe.node}, if not some other \texttt{XiMpLe} class.\footnote{The machanism for JavaScript is basically the same, but those classes and tools
+are all part of \texttt{rkwarddev} itself.}
+
+\subsection{What you see is what you get, in the end}
+Both packages also come with \texttt{show} methods for their objects. This means that the object you create and how it looks when called
+in an R session are not the same: What you will see in your terminal is what the object \textit{would} look like if you \textit{pasted} it
+to a file, using the \texttt{paste} functions of the packages:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> rk.XML.frame(label="Example XML object")
+ \end{Sinput}
+ \begin{Soutput}
+<frame label="Example XML object" id="frm_ExmplXML">
+</frame>
+ \end{Soutput}
+ \end{Schunk}
+
+If you examine the actual structure of the created object with \texttt{str()}, you can see the gory details:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> str(rk.XML.frame(label="Example XML object"))
+ \end{Sinput}
+ \begin{Soutput}
+Formal class 'XiMpLe.node' [package "XiMpLe"] with 4 slots
+ ..@ name : chr "frame"
+ ..@ attributes:List of 2
+ .. ..$ label: chr "Example XML object"
+ .. ..$ id : chr "frm_ExmplXML"
+ ..@ children : list()
+ ..@ value : chr ""
+ \end{Soutput}
+ \end{Schunk}
+
+Most of the time, you won't ever have to worry about that, since the objects will be handled by the package functions automatically.
+But it's important to understand that the results of these functions aren't simple character strings, allthough it might look like it
+at a first glance.
+
+\subsection{Generating XML code}
+In the section before, we have already generated our first XML object: the \texttt{rkwarddev} function \texttt{rk.XML.frame()} produced
+a \texttt{<frame>} node. I guess this is pretty straight forward. Usually, a frame needs some content nodes to make sense, so we'll now
+create two simple checkbox\footnote{As an almost unique exception, the name of \texttt{rk.XML.cbox()} does not match the name of the
+generated XML node, ''checkbox``. Don't worry about that.} objects, put them inside the frame and look at the result:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> myCheckbox <- rk.XML.cbox(label="Check me!")
+> myCheckbox2 <- rk.XML.cbox(label="No, check me!!!", chk=TRUE)
+> myFrame <- rk.XML.frame(myCheckbox, myCheckbox2, label="Example XML object")
+> myFrame
+ \end{Sinput}
+ \begin{Soutput}
+<frame label="Example XML object" id="frm_ExmplXML">
+ <checkbox id="chc_Checkme" label="Check me!" value="true" />
+ <checkbox id="chc_Nocheckm" label="No, check me!!!" value="true" checked="true" />
+</frame>
+ \end{Soutput}
+ \end{Schunk}
+
+What we can see here is that the generated code will automatically be indented, so the result will not only work, but still be human readable
+and look nice (and probably even better than what some might come up with otherwise...). We can also learn how nodes are made nested children
+of other nodes: All \texttt{rkwarddev} functions which can create parent to more than one node have the special ''dots`` parameter in their
+signature (\texttt{...}). That way you can give them arbitrary numbers of XML objects, and they just know what you want them to do with them.
+
+\subsubsection{IDs}
+If you have a closer look you can also see one of the packages' automatic features: The node objects automatically received
+ID values, allthough we didn't specify any. By default, allmost all functions supporting IDs have \texttt{id.name="auto"} set,
+which as we've seen will not cause the ID to become \texttt{"auto"}, but a generated value. Usually an auto-ID is combined
+of the abbreviated node type and the abbreviated label given. So here, our \texttt{<frame>} node labelled ''Example XML object`` got the
+ID \texttt{frm\_ExmplXML}. If we wanted a node to have some specific ID, we can use the \texttt{id.name} argument:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> rk.XML.cbox(label="Check me!", id.name="specificID")
+ \end{Sinput}
+ \begin{Soutput}
+<checkbox id="specificID" label="Check me!" value="true" />
+ \end{Soutput}
+ \end{Schunk}
+
+Now, the fact that these nodes are actually objects of class \texttt{XiMpLe.node} gives us direct access to their attributes, including the ID:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> myCheckbox <- rk.XML.cbox(label="Check me!")
+> myCheckbox at attributes[["id"]]
+ \end{Sinput}
+ \begin{Soutput}
+[1] "chc_Checkme"
+ \end{Soutput}
+ \end{Schunk}
+
+Again, mere mortals probably won't use this directly, but this makes it easy for functions read the IDs of XML nodes and use them. For example,
+if you wanted to define a varselector and a varslot, so the latter can take objects from the former, you need to give the varselector an ID and
+define that as the source in the varslot. If you wrote XML directly, you would give the \texttt{source} attribute the actual ID. With this package,
+you \textit{can} do that too, but there is a much more elegant solution: Give the whole XML object and let the function extract the ID itself:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> (myVarselector <- rk.XML.varselector(id.name="my_vars"))
+ \end{Sinput}
+ \begin{Soutput}
+<varselector id="my_vars" />
+ \end{Soutput}
+ \begin{Sinput}
+> (myVars <- rk.XML.varslot(label="Chose a variable", source=myVarselector))
+ \end{Sinput}
+ \begin{Soutput}
+<varslot id="vrsl_Chosvrbl" label="Chose a variable" source="my_vars" />
+ \end{Soutput}
+ \end{Schunk}
+
+So basically you define an XML object and then re-use this single object throughout your plugin script, be it for actual XML generation or, as
+in this case, only for getting its ID. This means, in other words, you can tell the varslot ''take variables from this object``, you don't have
+to worry about IDs \textit{at all}. Just remember how you named an object and you can do all kinds of things with it.
+
+This context dependent object handling will become even more useful when we get to the JavaScript part.
+
+\subsubsection{From single elements to a dialog}
+Once you have an idea which elements you would like to see in your dialog, and have also created individual XML objects of them, you finally have to
+put them all together to form the full dialog XML. This is done by \texttt{rk.XML.dialog()}, in the same manner that \texttt{rk.XML.frame()} was used.
+To get the layout into the desired structure, use \texttt{rk.XML.row()} and \texttt{rk.XML.col()} to group elements into rows and columns, as nested
+as you see fit:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> (myDialog <- rk.XML.dialog(
++ rk.XML.row(
++ myVarselector,
++ rk.XML.col(myVars, myFrame)),
++ label="Example dialog"))
+ \end{Sinput}
+ \begin{Soutput}
+<dialog label="Example dialog">
+ <row id="row_vCCEXMLEXM">
+ <varselector id="my_vars" />
+ <column id="clm_vCCEXMLEXM">
+ <varslot id="vrsl_Chosvrbl" label="Chose a variable" source="my_vars" />
+ <frame label="Example XML object" id="frm_ExmplXML">
+ <checkbox id="chc_Checkme" label="Check me!" value="true" />
+ <checkbox id="chc_Nocheckm" label="No, check me!!!" value="true" checked="true" />
+ </frame>
+ </column>
+ </row>
+</dialog>
+ \end{Soutput}
+ \end{Schunk}
+
+Now, wouldn't it be nice to see how that looks like in \texttt{RKWard}? Well, you can:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> rk.plugin.skeleton(
++ about="Example plugin",
++ xml=list(dialog=myDialog),
++ load=TRUE,
++ show=TRUE
++ )
+ \end{Sinput}
+ \begin{Soutput}
+For filenames ‘Example plugin’ was renamed to ‘Exampleplugin’.
+Created directory /tmp/Rtmp9gdThb/Exampleplugin.
+Created directory /tmp/Rtmp9gdThb/Exampleplugin/R.
+Created directory /tmp/Rtmp9gdThb/Exampleplugin/inst/rkward/plugins.
+Created directory /tmp/Rtmp9gdThb/Exampleplugin/inst/rkward/tests/Exampleplugin.
+For filenames ‘Example plugin’ was renamed to ‘Exampleplugin’.
+For filenames ‘Example plugin’ was renamed to ‘Exampleplugin’.
+For filenames ‘Example plugin’ was renamed to ‘Exampleplugin’.
+For filenames ‘Example plugin’ was renamed to ‘Exampleplugin’.
+[1] "/tmp/Rtmp9gdThb/Exampleplugin"
+ \end{Soutput}
+ \end{Schunk}
+
+Allthough until now all we did was to outline the XML description of our plugin-to-become, \texttt{rkwarddev}
+can already generate a full plugin. \texttt{load=TRUE} makes sure that \texttt{RKWard} recognizes the new plugin
+immediately after it was created, and \texttt{show=TRUE} will even make it pop up, too:
+
+\begin{center}
+ \includegraphics{./RKWard_vign_example_dialog_wcode.png}
+ % RKWard_vign_example_dialog_wcode.png: 423x407 pixel, 99dpi, 10.85x10.44 cm, bb=0 0 308 296
+\end{center}
+
+Not bad for less than 20 short lines of code. This makes dialog design both very efficient and flexible:
+Imagine you want to re-arrange the order of elements, or experiment with completely different tabbook layouts, all you need to
+do is to change the \texttt{rk.XML.dialog()} call and run \texttt{rk.plugin.skeleton()} again (with \texttt{overwrite=TRUE}).
+If you don't specify a directory explicitly, all will be written to a temporary directory. As seen in the example output,
+the return value of \texttt{rk.plugin.skeleton()} is allways the root directory of the created plugin.
+
+Looking at the attribute \texttt{xml=list(dialog=myDialog)}, we can assume that
+
+\begin{enumerate}
+ \item there's more than a \texttt{dialog} we can provide\\
+ \textit{Further valid options are \texttt{wizard}, \texttt{logic} and \texttt{snippets}}
+ \item there's more to define than just the \texttt{xml} of a plugin
+ \textit{Further arguments include \texttt{js}, \texttt{pluginmap}, \texttt{rkh} and \texttt{components}, among others}
+\end{enumerate}
+
+Of course, this plugin doesn't really do anything useful. In fact, it doesn't matter how you treat the buttons and boxes, the R code below
+won't change a bit, because we didn't provide any JavaScript code to deal with those events.
+
+\subsection{Generating JavaScript code}
+In contrast to what we've seen with the XML code, where objects are nested into others and the result is one big XML object, generated JavaScript code
+is always a plain character string in the end. This is because it doesn't make much sense to treat a programming language otherwise, if you don't want
+to lose its flexibility. But in between, existing objects will be re-used and new ones created as well. The best way to understand how \texttt{rkwarddev}
+handles the JavaScript part is to think of it as a specialized \texttt{paste()}. Its special feature is that it understands the objects we're dealing
+with, and depending on where they occur, knows what strings to make out of them.
+
+Therefore, the most direct approach to get JavaScript into the plugin would to write it all by hand, paste it into a character object and give that to
+\texttt{rk.plugin.skeleton()}. But again, \texttt{rkwarddev} offers some helpful tools.
+
+\subsubsection{Defining variables}
+We just created the XML dialog, which in turn of course includes all the elements (and their IDs) we need to care about. Or the other way round:
+For each element in the dialog it is pretty safe to assume that it should have \textit{some} effect on the outcome. So for a start, \texttt{rkwarddev}
+can ''scan`` the dialog object\footnote{In fact, \texttt{rk.JS.scan()} is not limited to R objects but can also read XML files.},
+collect all relevant IDs and define them as JavaScript variables automatically. Try this for a demonstration:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> cat(rk.JS.scan(myDialog))
+ \end{Sinput}
+ \begin{Soutput}
+ var vrslChosvrbl = getValue("vrsl_Chosvrbl");
+ var chcCheckme = getValue("chc_Checkme");
+ var chcNocheckm = getValue("chc_Nocheckm");
+ \end{Soutput}
+ \end{Schunk}
+
+Notice that only the varslot and both checkboxes show up -- \texttt{rk.JS.scan()} distinguishes between relevant and irrelevant IDs, e.\,g. a
+row or column is no GUI element of interest here. By the way, if you defined the frame as \texttt{checkable=TRUE}, its ID would be
+extracted as well.\footnote{There is also a related function called \texttt{rk.JS.saveobj()}, which scans for \texttt{<saveobject>} nodes and
+does not only define the neccessary variables, but also generates the full JavaScript code snippet for the \texttt{printout()} function,
+to effectively save result objects to workspace.}
+
+You might also notice that the JavaScript variable names differ from the XML IDs. For once, that way they're harder to confuse with each other,
+and there's also some conventions which characters are allowed. But to cut things short, we don't have to worry about the variable names,
+just like we didn't have to care about the XML IDs before. We don't even have to call \texttt{rk.JS.scan()} ourselves, as
+\texttt{rk.plugin.skeleton()} will do so where appropriate, if the option \texttt{scan} includes \texttt{"var"}, which by default is the case.
+
+This means, once more we can concentrate on what the plugin shall actually do, perhaps some calculation of a kind.
+
+\subsubsection{Shortcut functions}
+The common task here is to check for certain dialog events (like unchecking the checkbox labelled ''foo``), and then generate the according
+\texttt{R} code (like \texttt{foo=FALSE}). The question remains, if we don't know the actual variable names, how can we check for events
+of certain dialog elements in the JavaScript code? The answer to that is: We generate the code using \texttt{rkwarddev}'s special
+JavaScripting functions and paste it with \texttt{rk.paste.JS()}. That way, we can use the created XML objects once again, as reference
+to which element we actually mean.
+
+\paragraph{echo()}
+The JavaScript equivalent to \texttt{paste()} is \texttt{echo()}, with a slightly different
+syntax: Concatenation is not done by commas, but by the plus sign, and the line must end with a semicolon. This is an example why it might be
+nice to not need to switch between languages back and forth any more. So \texttt{rkwarddev} has an \texttt{R} function called \texttt{echo()},
+which translates \texttt{paste()}-like arguments into an equivalent JavaScript call:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> echo("# Value of the checkbox is: ", myCheckbox, "\n")
+ \end{Sinput}
+ \begin{Soutput}
+[1] "echo(\"# Value of the checkbox is: \" + chcCheckme + "\n");"
+ \end{Soutput}
+ \end{Schunk}
+
+If this JavaScript code line was used, it would simply add a comment regarding the checkbox value to the \texttt{R} code,
+including a newline.
+
+\paragraph{ite()}
+Now we know how to paste JavaScript code which echoes \texttt{R} code. What we definitely need at some point is \texttt{if()} conditions. For
+that, \texttt{rkwarddev} offers \texttt{ite()}. The function takes up to three arguments: One ''if`` condition, one ''then`` action, and optionally
+one ''else`` action. But actually, neither will the ''if`` condition be evaluated, nor will any of the actions be taken. The arguments just
+define what should be \textit{pasted} at which part if the conditional statement:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> ite("foo", "bar", "baz")
+ \end{Sinput}
+ \begin{Soutput}
+ if(foo) {
+ bar
+ } else {
+ baz
+ }
+ \end{Soutput}
+ \end{Schunk}
+
+However, in contrast to \texttt{echo()}, what \texttt{ite()} returns is not a character string, but similar to what we've seen with the XML
+functions a special JavaScript object. Amongst other things, this is useful to again generate readable code, e.\,g. nested conditions:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> ite(myCheckbox,
++ ite(myVars,
++ echo("result <- ", myVars, "\n"),
++ echo("# huh?\n")
++ ),
++ ite(myCheckbox2,
++ echo("## ouch!\n")
++ )
++ )
+ \end{Sinput}
+ \begin{Soutput}
+ if(chcCheckme) {
+ if(vrslChosvrbl) {
+ echo("result <- " + vrslChosvrbl + "\n");
+ } else {
+ echo("# huh?\n");
+ }
+ } else if(chcNocheckm) {
+ echo("## ouch!\n");
+ } else {}
+ \end{Soutput}
+ \end{Schunk}
+
+To finally use this object in the plugin, it must be evaluated and transformed into a character string.
+
+\paragraph{rk.paste.JS()}
+This is where \texttt{rk.paste.JS()} comes into play:
+
+ \begin{Schunk}
+ \begin{Sinput}
+> myCalculation <- rk.paste.JS(
++ ite(myCheckbox,
++ ite(myVars,
++ echo("result <- ", myVars, "\n"),
++ echo("# huh?\n")
++ ),
++ ite(myCheckbox2,
++ echo("## ouch!\n")
++ )
++ )
++ )
++ rk.plugin.skeleton(
++ about="Example plugin",
++ xml=list(dialog=myDialog),
++ js=list(calculate=myCalculation),
++ load=TRUE,
++ show=TRUE,
++ overwrite=TRUE
++ )
+ \end{Sinput}
+ \begin{Soutput}
+For filenames 'Example plugin' was renamed to 'Exampleplugin'.
+For filenames 'Example plugin' was renamed to 'Exampleplugin'.
+For filenames 'Example plugin' was renamed to 'Exampleplugin'.
+For filenames 'Example plugin' was renamed to 'Exampleplugin'.
+For filenames 'Example plugin' was renamed to 'Exampleplugin'.
+[1] "/tmp/Rtmp9gdThb/Exampleplugin"
+ \end{Soutput}
+ \end{Schunk}
+
+Now the plugin actually changes the generated code if you select an object from the workspace and toggle the checkboxes:
+
+\begin{center}
+ \includegraphics{./RKWard_vign_example_dialog_wcode_JS.png}
+ % RKWard_vign_example_dialog_wcode_JS.png: 763x453 pixel, 99dpi, 19.57x11.62 cm, bb=0 0 555 329
+\end{center}
+
+% \subsection{The whole is more than the sum of its parts}
+%
+%
+%
+% \begin{Schunk}
+% \begin{Sinput}
+% s
+% \end{Sinput}
+% \begin{Soutput}
+% s
+% \end{Soutput}
+% \end{Schunk}
+
+% \begin{Schunk}
+% \begin{Sinput}
+% \end{Sinput}
+% \begin{Soutput}
+% \end{Soutput}
+% \end{Schunk}
+
+% \bibliographystyle{apacite}
+% \addcontentsline{toc}{chapter}{\bibname}
+% \bibliography{rkwarddev_lit}
+
+\end{document}
Added: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
===================================================================
(Binary files differ)
Index: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf 2014-09-01 13:31:28 UTC (rev 4798)
Property changes on: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: trunk/rkward/packages/rkwarddev/man/echo.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/echo.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/echo.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{echo}
\alias{echo}
\title{Generate JavaScript echo command call}
@@ -2,23 +3,21 @@
\usage{
- echo(..., newline = "")
+echo(..., newline = "")
}
\arguments{
- \item{...}{One or several character strings and/or
- \code{XiMpLe.node} objects with plugin nodes, and/or
- objects of classes \code{rk.JS.arr} or \code{rk.JS.opt},
- simply separated by comma.}
+\item{...}{One or several character strings and/or \code{XiMpLe.node} objects with plugin nodes,
+and/or objects of classes \code{rk.JS.arr} or \code{rk.JS.opt},
+ simply separated by comma.}
- \item{newline}{Character string, can be set to e.g.
- \code{"\n"} to force a newline after the call.}
+\item{newline}{Character string,
+ can be set to e.g. \code{"\n"} to force a newline after the call.}
}
\value{
- A character string.
+A character string.
}
\description{
- This function will take several elements, either
- character strings, or objects of class \code{XiMpLe.node}
- which hold an XML node of some plugin GUI definition, or
- objects of classes \code{rk.JS.arr} or \code{rk.JS.opt}.
- From those, it will generate a ready-to-run JavaScript
- \code{echo();} call from it.
+This function will take several elements, either character strings,
+ or objects of class \code{XiMpLe.node}
+which hold an XML node of some plugin GUI definition,
+ or objects of classes \code{rk.JS.arr} or \code{rk.JS.opt}.
+From those, it will generate a ready-to-run JavaScript \code{echo();} call from it.
}
@@ -29,13 +28,12 @@
echo("bar <- \\"", cbox1, "\\"")
}
\seealso{
- \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
- \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
- \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
- \code{\link[rkwarddev:ite]{ite}},
- \code{\link[rkwarddev:id]{id}},
- \code{\link[rkwarddev:id]{qp}}, and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
+ \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
+ \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
+ \code{\link[rkwarddev:ite]{ite}},
+ \code{\link[rkwarddev:id]{id}},
+ \code{\link[rkwarddev:id]{qp}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Added: trunk/rkward/packages/rkwarddev/man/i18n.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/i18n.Rd (rev 0)
+++ trunk/rkward/packages/rkwarddev/man/i18n.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -0,0 +1,32 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
+\name{i18n}
+\alias{i18n}
+\title{Translate parts of a plugin}
+\usage{
+i18n(..., lang = rk.get.language())
+}
+\arguments{
+\item{...}{Comma separated, named elements, see description.}
+
+\item{lang}{Character string, the language to return.}
+}
+\description{
+Takes a list of entries named after abbreviated languages, and returns
+either the one matching the language set with \code{\link[rkwarddev:rk.set.language]{rk.set.language}},
+or the first entry if no language was set at all or the set language cannot be found in
+\code{...}.
+}
+\details{
+If used in an \code{rkwarddev} script,
+ this can be used to toggle the generation of plugins
+in a certain language.
+}
+\examples{
+rk.set.language("en", c("en_EN", "en_US"))
+(var.select <- rk.XML.varselector(label=i18n(en="Select data", de="Wähle Daten")))
+
+# now try the same with the alternate language
+rk.set.language("de", "de_DE")
+(var.select <- rk.XML.varselector(label=i18n(en="Select data", de="Wähle Daten")))
+}
+
Modified: trunk/rkward/packages/rkwarddev/man/id.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/id.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/id.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{id}
\alias{id}
\title{Replace XiMpLe.node objects with their ID value}
@@ -2,32 +3,31 @@
\usage{
- id(..., quote = FALSE, collapse = "", js = TRUE)
+id(..., quote = FALSE, collapse = "", js = TRUE)
}
\arguments{
- \item{...}{One or several character strings and/or
- \code{XiMpLe.node} objects with plugin nodes, and/or
- objects of classes \code{rk.JS.arr}, \code{rk.JS.opt} or
- \code{rk.JS.var}, simply separated by comma.}
+\item{...}{One or several character strings and/or \code{XiMpLe.node} objects with plugin nodes,
+and/or objects of classes \code{rk.JS.arr}, \code{rk.JS.opt} or \code{rk.JS.var},
+ simply separated by comma.}
- \item{quote}{Logical, it the character strings sould be
- deparsed, so they come out "as-is" when written to files,
- e.g. by \code{cat}.}
+\item{quote}{Logical, it the character strings sould be deparsed,
+ so they come out "as-is" when
+written to files, e.g. by \code{cat}.}
- \item{collapse}{Character string, defining if and how the
- individual elements should be glued together.}
+\item{collapse}{Character string,
+ defining if and how the individual elements should be glued together.}
- \item{js}{Logical, if \code{TRUE} returns JavaScript
- varaible names for \code{XiMpLe.node} objects. Otherwise
- their actual ID is returned.}
+\item{js}{Logical,
+ if \code{TRUE} returns JavaScript varaible names for \code{XiMpLe.node} objects.
+Otherwise their actual ID is returned.}
}
\value{
- A character string.
+A character string.
}
\description{
- This function is intended to be used for generating
- JavaScript code for RKWard plugins. Its sole purpose is
- to replace objects of class \code{XiMpLe.node} which hold
- an XML node of some plugin GUI definition, and objects of
- classes \code{rk.JS.arr}, \code{rk.JS.opt} or
- \code{rk.JS.var} with their ID (or JS variable name), and
- combine these replacements with character strings.
+This function is intended to be used for generating JavaScript code for
+RKWard plugins. Its sole purpose is to replace objects of class \code{XiMpLe.node}
+which hold an XML node of some plugin GUI definition,
+ and objects of classes \code{rk.JS.arr},
+\code{rk.JS.opt} or \code{rk.JS.var} with their ID (or JS variable name),
+ and combine these
+replacements with character strings.
}
@@ -39,13 +39,11 @@
id("The variable name is: ", cbox1, "!")
}
\seealso{
- \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
- \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
- \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
- \code{\link[rkwarddev:echo]{echo}},
- \code{\link[rkwarddev:qp]{qp}} (a shortcut for \code{id}
- with different defaults), and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
+ \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
+ \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
+ \code{\link[rkwarddev:echo]{echo}},
+ \code{\link[rkwarddev:qp]{qp}} (a shortcut for \code{id} with different defaults),
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/ite.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/ite.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/ite.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{ite}
\alias{ite}
\title{Generate JavaScript if/then/else constructs}
@@ -2,27 +3,22 @@
\usage{
- ite(ifjs, thenjs, elsejs = NULL)
+ite(ifjs, thenjs, elsejs = NULL)
}
\arguments{
- \item{ifjs}{Either a character string to be placed in the
- brackets if an \code{if()} statement, or an object of
- class \code{XiMpLe.node}. \code{rk.JS.arr} or
- \code{rk.JS.opt} (whose identifier will be used).}
+\item{ifjs}{Either a character string to be placed in the brackets if an \code{if()} statement,
+or an object of class \code{XiMpLe.node}. \code{rk.JS.arr} or \code{rk.JS.opt} (whose identifier will be used).}
- \item{thenjs}{Either a character string, the code to be
- executed in case the \code{if()} statement is true, or an
- object of class \code{XiMpLe.node}. \code{rk.JS.arr} or
- \code{rk.JS.opt} (whose identifier will be used). The
- latter is especially useful in combination with
- \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}}.
- You can also give another object of class
- \code{rk.JS.ite}.}
+\item{thenjs}{Either a character string,
+ the code to be executed in case the \code{if()} statement is true,
+or an object of class \code{XiMpLe.node}. \code{rk.JS.arr} or \code{rk.JS.opt} (whose identifier will be used).
+The latter is especially useful in combination with \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}}.
+You can also give another object of class \code{rk.JS.ite}.}
- \item{elsejs}{Like \code{thenjs}, the code to be executed
- in case the \code{if()} statement is not true.}
+\item{elsejs}{Like \code{thenjs},
+ the code to be executed in case the \code{if()} statement is not true.}
}
\value{
- An object of class \code{rk.JS.ite}
+An object of class \code{rk.JS.ite}
}
\description{
- Generate JavaScript if/then/else constructs
+Generate JavaScript if/then/else constructs
}
@@ -35,14 +31,13 @@
ite(cbox1, echo("bar <- \\"", cbox1, "\\""), echo("bar <- NULL"))
}
\seealso{
- \code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
- \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
- \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
- \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
- \code{\link[rkwarddev:echo]{echo}},
- \code{\link[rkwarddev:id]{id}},
- \code{\link[rkwarddev:qp]{qp}}, and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
+ \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
+ \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
+ \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
+ \code{\link[rkwarddev:echo]{echo}},
+ \code{\link[rkwarddev:id]{id}},
+ \code{\link[rkwarddev:qp]{qp}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/join.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/join.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/join.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{join}
\alias{join}
\title{Generate JavaScript to join an array object}
@@ -2,35 +3,29 @@
\usage{
- join(var, by = "\", \"")
+join(var, by = "\\", \\"")
}
\arguments{
- \item{var}{Either a character string (the name of the
- variable to combine to a vector or list), or an object of
- class \code{XiMpLe.node} (whose ID will be extracted and
- used). Also accepts objects of class \code{rk.JS.arr}.}
+\item{var}{Either a character string (the name of the variable to combine to a vector or list),
+or an object of class \code{XiMpLe.node} (whose ID will be extracted and used). Also
+accepts objects of class \code{rk.JS.arr}.}
- \item{by}{Character string by which the values ought to
- be joined.}
+\item{by}{Character string by which the values ought to be joined.}
}
\value{
- An object of class \code{rk.JS.echo}.
+An object of class \code{rk.JS.echo}.
}
\description{
- This function pastes an object of class \code{rk.JS.arr}
- similar to
- \code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}}, but was
- specifically written for elements like \code{<optionset>}
- or \code{<matrix>}, whose values must be queried by
- \code{getList()} rather than \code{getValue()}. This
- means, the resulting variable is already an array an
- merely needs to be joined in as R code output (e.g., an
- \code{<optioncolumn>}).
+This function pastes an object of class \code{rk.JS.arr} similar to \code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
+but was specifically written for elements like \code{<optionset>} or \code{<matrix>},
+ whose values must be queried
+by \code{getList()} rather than \code{getValue()}. This means,
+ the resulting variable is already an array an merely
+needs to be joined in as R code output (e.g., an \code{<optioncolumn>}).
}
\seealso{
- \code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
- \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
- \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
- \code{\link[rkwarddev:echo]{echo}},
- \code{\link[rkwarddev:id]{id}}, and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
+ \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
+ \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
+ \code{\link[rkwarddev:echo]{echo}},
+ \code{\link[rkwarddev:id]{id}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/qp.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/qp.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/qp.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{qp}
\alias{qp}
\title{Replace XiMpLe.node objects with their ID value}
@@ -2,18 +3,15 @@
\usage{
- qp(...)
+qp(...)
}
\arguments{
- \item{...}{One or several character strings and/or
- \code{XiMpLe.node} objects with plugin nodes, and/or
- objects of classes \code{rk.JS.arr} or \code{rk.JS.opt},
- simply separated by comma.}
+\item{...}{One or several character strings and/or \code{XiMpLe.node} objects with plugin nodes,
+and/or objects of classes \code{rk.JS.arr} or \code{rk.JS.opt},
+ simply separated by comma.}
}
\value{
- A character string.
+A character string.
}
\description{
- This function is a shortcut for
- \code{\link[rkwarddev:id]{id}} which sets some useful
- defaults (\code{quote=TRUE, collapse=" + ", js=TRUE}).
- The abbreviation stands for "quote + plus".
+This function is a shortcut for \code{\link[rkwarddev:id]{id}} which sets some useful defaults
+(\code{quote=TRUE, collapse=" + ", js=TRUE}). The abbreviation stands for "quote + plus".
}
@@ -25,12 +23,11 @@
qp("The variable name is: ", cbox1, "!")
}
\seealso{
- \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
- \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
- \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
- \code{\link[rkwarddev:echo]{echo}},
- \code{\link[rkwarddev:id]{id}}, and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
+ \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
+ \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
+ \code{\link[rkwarddev:echo]{echo}},
+ \code{\link[rkwarddev:id]{id}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.JS.array.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.JS.array.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.JS.array.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.JS.array}
\alias{rk.JS.array}
\title{Create a simple JavaScript array}
@@ -2,35 +3,29 @@
\usage{
- rk.JS.array(option, variables = list(), funct = "c",
- var.prefix = NULL, quote = FALSE)
+rk.JS.array(option, variables = list(), funct = "c", var.prefix = NULL,
+ quote = FALSE)
}
\arguments{
- \item{option}{A character string, naming, e.g., an option
- of an R function which should be constructed from several
- variables.}
+\item{option}{A character string, naming, e.g., an option of an R function which should be
+constructed from several variables.}
- \item{variables}{A list with either character strings
- (the names of the variables to combine to a vector or
- list), or objects of class \code{XiMpLe.node} with plugin
- XML nodes (whose ID will be extracted and used).}
+\item{variables}{A list with either character strings (the names of the variables to combine to a vector or list),
+or objects of class \code{XiMpLe.node} with plugin XML nodes (whose ID will be extracted and used).}
- \item{funct}{Character string, name of the R function to
- be called to combine the options, e.g. "list" for
- \code{list()}, or "c" for \code{c()}.}
+\item{funct}{Character string, name of the R function to be called to combine the options,
+ e.g. "list" for \code{list()},
+or "c" for \code{c()}.}
- \item{var.prefix}{A character string. sets a global
- string to be used as a prefix for the JS variable names.}
+\item{var.prefix}{A character string. sets a global string to be used as a prefix for the JS variable names.}
- \item{quote}{Logical, if \code{TRUE}, the values will be
- quoted in the resulting R code (might be neccessary for
- character values).}
+\item{quote}{Logical, if \code{TRUE},
+ the values will be quoted in the resulting R code (might be neccessary
+for character values).}
}
\value{
- An object of class \code{rk.JS.arr}.
+An object of class \code{rk.JS.arr}.
}
\description{
- If you need to combine multiple options (like values of
- several checkboxes) into one vector or list, this
- function can help with that task. All relevant variables
- will become part of an array and then joined into the
- desired argument type.
+If you need to combine multiple options (like values of several checkboxes) into one vector or list,
+this function can help with that task. All relevant variables will become part of an array and
+then joined into the desired argument type.
}
@@ -45,12 +40,11 @@
rk.JS.array("run.tests", variables=list(checkA, checkB, checkC), funct="list")
}
\seealso{
- \code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
- \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
- \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
- \code{\link[rkwarddev:echo]{echo}},
- \code{\link[rkwarddev:id]{id}}, and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
+ \code{\link[rkwarddev:rk.JS.options]{rk.JS.options}},
+ \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
+ \code{\link[rkwarddev:echo]{echo}},
+ \code{\link[rkwarddev:id]{id}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.JS.doc.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.JS.doc.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.JS.doc.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.JS.doc}
\alias{rk.JS.doc}
\title{Create JavaScript outline from RKWard plugin XML}
@@ -2,84 +3,64 @@
\usage{
- rk.JS.doc(require = c(), variables = NULL,
- globals = NULL, results.header = NULL,
- preprocess = NULL, calculate = NULL, printout = NULL,
- doPrintout = NULL, load.silencer = NULL,
- gen.info = TRUE, indent.by = "\t")
+rk.JS.doc(require = c(), variables = NULL, globals = NULL,
+ results.header = NULL, preprocess = NULL, calculate = NULL,
+ printout = NULL, doPrintout = NULL, load.silencer = NULL,
+ gen.info = TRUE, indent.by = "\\t")
}
\arguments{
- \item{require}{A character vector with names of R
- packages that the dialog depends on.}
+\item{require}{A character vector with names of R packages that the dialog depends on.}
- \item{variables}{Either a character string to be included
- to read in all needed variables from the dialog (see
- \code{\link{rk.JS.scan}}), or an object of class
- \code{rk.JS.var} which will be coerced into character.
- These variables will be defined in the \code{calculate()}
- and/or \code{doPrintout()} functions.}
+\item{variables}{Either a character string to be included to read in all needed variables from the dialog (see \code{\link{rk.JS.scan}}),
+or an object of class \code{rk.JS.var} which will be coerced into character. These variables will be defined in
+the \code{calculate()} and/or \code{doPrintout()} functions.}
- \item{globals}{Like \code{variables}, but these variables
- will be defined globally. If \code{variables} is set as
- well, the function tries to remove duplicate
- definitions.}
+\item{globals}{Like \code{variables},
+ but these variables will be defined globally. If \code{variables} is set as well,
+the function tries to remove duplicate definitions.}
- \item{results.header}{A character string to headline the
- printed results. Include escapes quotes (\\") if needed.
- Set to \code{FALSE} or \code{""} if you need more control
- and want to define the header section in
- \code{printout}.}
+\item{results.header}{A character string to headline the printed results. Include escapes quotes (\\") if needed.
+Set to \code{FALSE} or \code{""} if you need more control and want to define the header section in \code{printout}.}
- \item{preprocess}{A character string to be included in
- the \code{preprocess()} function. This string will be
- pasted as-is, after \code{require} has been evaluated.}
+\item{preprocess}{A character string to be included in the \code{preprocess()} function. This string will be
+pasted as-is, after \code{require} has been evaluated.}
- \item{calculate}{A character string to be included in the
- \code{calculate()} function. This string will be pasted
- as-is, after \code{variables} has been evaluated.}
+\item{calculate}{A character string to be included in the \code{calculate()} function. This string will be
+pasted as-is, after \code{variables} has been evaluated.}
- \item{printout}{A character string to be included in the
- \code{printout()} function. This string will be pasted
- as-is, after \code{results.header} has been evaluated.
- Ignored if \code{doPrintout} is set.}
+\item{printout}{A character string to be included in the \code{printout()} function. This string will be
+pasted as-is,
+ after \code{results.header} has been evaluated. Ignored if \code{doPrintout} is set.}
- \item{doPrintout}{A character string to be included in
- the \code{doPrintout()} function. This string will be
- pasted as-is. You don't need to define a \code{preview()}
- function, as this will be added automatically. Use
- \code{ite("full", ...)} style JavaScript code to include
- headers etc.}
+\item{doPrintout}{A character string to be included in the \code{doPrintout()} function. This string will be
+pasted as-is. You don't need to define a \code{preview()} function,
+ as this will be added automatically.
+Use \code{ite("full", ...)} style JavaScript code to include headers etc.}
- \item{load.silencer}{Either a character string (ID of
- probably a checkbox), or an object of class
- \code{XiMpLe.node}. This defines a switch you can add to
- your plugin, to set the \code{require()} call inside
- \code{suppressMessages()}, hence suppressing all load
- messages (except for warnings and errors) of required
- packages in the output.}
+\item{load.silencer}{Either a character string (ID of probably a checkbox),
+ or an object of class \code{XiMpLe.node}.
+This defines a switch you can add to your plugin,
+ to set the \code{require()} call inside \code{suppressMessages()},
+hence suppressing all load messages (except for warnings and errors) of required packages in the output.}
- \item{gen.info}{Logical, if \code{TRUE} a comment note
- will be written into the document, that it was generated
- by \code{rkwarddev} and changes should be done to the
- script.}
+\item{gen.info}{Logical, if \code{TRUE} a comment note will be written into the document,
+that it was generated by \code{rkwarddev} and changes should be done to the script.}
- \item{indent.by}{A character string defining how
- indentation should be done.}
+\item{indent.by}{A character string defining how indentation should be done.}
}
\value{
- A character string.
+A character string.
}
\description{
- Create JavaScript outline from RKWard plugin XML
+Create JavaScript outline from RKWard plugin XML
}
\note{
- The JavaScript
+The JavaScript
}
\seealso{
- \code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
- \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
- \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
- \code{\link[rkwarddev:ite]{ite}},
- \code{\link[rkwarddev:echo]{echo}},
- \code{\link[rkwarddev:id]{id}}, and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}},
+ \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
+ \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
+ \code{\link[rkwarddev:ite]{ite}},
+ \code{\link[rkwarddev:echo]{echo}},
+ \code{\link[rkwarddev:id]{id}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.JS.options.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.JS.options.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.JS.options.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.JS.options}
\alias{rk.JS.options}
\title{Combine several options in one JavaScript variable}
@@ -2,42 +3,36 @@
\usage{
- rk.JS.options(var, ..., collapse = ", ", option = NULL,
- funct = NULL, array = TRUE)
+rk.JS.options(var, ..., collapse = ", ", option = NULL, funct = NULL,
+ array = TRUE)
}
\arguments{
- \item{var}{Character string, name of the JavaScript
- variable to use in the script code.}
+\item{var}{Character string, name of the JavaScript variable to use in the script code.}
- \item{...}{A list of objects of class \code{rk.JS.ite}
- (see \code{\link[rkwarddev:ite]{ite}}). Use the
- \code{thenjs} element to define only the value to add to
- the option, without commas (e.g., \code{"paired=TRUE"} or
- \code{qp("conf.level=\"", conflevel, "\"")}.}
+\item{...}{A list of objects of class \code{rk.JS.ite} (see \code{\link[rkwarddev:ite]{ite}}).
+Use the \code{thenjs} element to define only the value to add to the option,
+ without commas
+(e.g., \code{"paired=TRUE"} or \code{qp("conf.level=\"", conflevel, "\"")}.}
- \item{collapse}{Character string, how all options should
- be concatenated on the R code level (if
- \code{array=FALSE}), or how \code{option} should be added
- to the generated R code. Hint: To place each option in a
- new line with tab indentation, set
- \code{collapse=",\\n\\t"}.}
+\item{collapse}{Character string,
+ how all options should be concatenated on the R code level
+(if \code{array=FALSE}),
+ or how \code{option} should be added to the generated R code. Hint:
+To place each option in a new line with tab indentation, set \code{collapse=",\\n\\t"}.}
- \item{option}{A character string, naming, e.g., an option
- of an R function which should be constructed from several
- variables. Only used if \code{array=TRUE}.}
+\item{option}{A character string, naming, e.g., an option of an R function which should be
+constructed from several variables. Only used if \code{array=TRUE}.}
- \item{funct}{Character string, name of the R function to
- be called to combine the options, e.g. "list" for
- \code{list()}, or "c" for \code{c()}. Set to \code{NULL}
- to drop. Only used if \code{array=TRUE}.}
+\item{funct}{Character string, name of the R function to be called to combine the options,
+e.g. "list" for \code{list()}, or "c" for \code{c()}. Set to \code{NULL} to drop.
+Only used if \code{array=TRUE}.}
- \item{array}{Logical, if \code{TRUE} will generate the
- options as an array, otherwise in one concatenated
- character string (probably only useful for mandatory
- options).}
+\item{array}{Logical, if \code{TRUE} will generate the options as an array,
+ otherwise in one
+concatenated character string (probably only useful for mandatory options).}
}
\value{
- An object of class \code{rk.JS.opt}, use
- \code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}} on that.
+An object of class \code{rk.JS.opt}, use \code{\link[rkwarddev:rk.paste.JS]{rk.paste.JS}}
+ on that.
}
\description{
- Combine several options in one JavaScript variable
+Combine several options in one JavaScript variable
}
@@ -54,8 +49,7 @@
)
}
\seealso{
- \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}}, and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.JS.saveobj.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.JS.saveobj.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.JS.saveobj.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.JS.saveobj}
\alias{rk.JS.saveobj}
\title{Create JavaScript saveobject code from plugin XML}
@@ -2,36 +3,33 @@
\usage{
- rk.JS.saveobj(pXML, R.objects = "initial", vars = TRUE,
- add.abbrev = FALSE, indent.by = "\t")
+rk.JS.saveobj(pXML, R.objects = "initial", vars = TRUE,
+ add.abbrev = FALSE, indent.by = "\\t")
}
\arguments{
- \item{pXML}{Either an object of class \code{XiMpLe.doc}
- or \code{XiMpLe.node}, or path to a plugin XML file.}
+\item{pXML}{Either an object of class \code{XiMpLe.doc} or \code{XiMpLe.node},
+ or path to a plugin XML file.}
- \item{R.objects}{Character vector, the names of the
- internal R objects to be saved. If not empty must have
- the same length as <saveobject> nodes in the document, or
- be the keyword "initial", in which case the
- \code{intital} attribute values of the nodes are used.}
+\item{R.objects}{Character vector,
+ the names of the internal R objects to be saved. If not empty must have
+the same length as <saveobject> nodes in the document, or be the keyword "initial",
+ in which case the
+\code{intital} attribute values of the nodes are used.}
- \item{vars}{Logocal, whether the variables needed should
- also be defined in the JavaScript code.}
+\item{vars}{Logocal,
+ whether the variables needed should also be defined in the JavaScript code.}
- \item{add.abbrev}{Logical, if \code{TRUE} the JavaScript
- variables will all have a prefix with an three letter
- abbreviation of the XML tag type to improve the
- readability of the code. But it's probably better to add
- this in the XML code in the first place.}
+\item{add.abbrev}{Logical,
+ if \code{TRUE} the JavaScript variables will all have a prefix with an
+three letter abbreviation of the XML tag type to improve the readability of the code. But it's
+probably better to add this in the XML code in the first place.}
- \item{indent.by}{Character string used to indent each
- entry if \code{js=TRUE}.}
+\item{indent.by}{Character string used to indent each entry if \code{js=TRUE}.}
}
\value{
- A character vector.
+A character vector.
}
\description{
- Create JavaScript saveobject code from plugin XML
+Create JavaScript saveobject code from plugin XML
}
\seealso{
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.JS.scan.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.JS.scan.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.JS.scan.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.JS.scan}
\alias{rk.JS.scan}
\title{Create JavaScript variables from plugin XML}
@@ -2,38 +3,35 @@
\usage{
- rk.JS.scan(pXML, js = TRUE, add.abbrev = FALSE,
- guess.getter = FALSE, indent.by = "\t")
+rk.JS.scan(pXML, js = TRUE, add.abbrev = FALSE, guess.getter = FALSE,
+ indent.by = "\\t")
}
\arguments{
- \item{pXML}{Either an object of class \code{XiMpLe.doc}
- or \code{XiMpLe.node}, or path to a plugin XML file.}
+\item{pXML}{Either an object of class \code{XiMpLe.doc} or \code{XiMpLe.node},
+ or path to a plugin XML file.}
- \item{js}{Logical, if \code{TRUE} usable JavaScript code
- will be returned, otherwise a character vector with only
- the relevant ID names.}
+\item{js}{Logical, if \code{TRUE} usable JavaScript code will be returned,
+ otherwise a character
+vector with only the relevant ID names.}
- \item{add.abbrev}{Logical, if \code{TRUE} the JavaScript
- variables will all have a prefix with an three letter
- abbreviation of the XML tag type to improve the
- readability of the code. But it's probably better to add
- this in the XML code in the first place.}
+\item{add.abbrev}{Logical,
+ if \code{TRUE} the JavaScript variables will all have a prefix with an
+three letter abbreviation of the XML tag type to improve the readability of the code. But it's
+probably better to add this in the XML code in the first place.}
- \item{guess.getter}{Logical, if \code{TRUE} try to get a
- good default getter function for JavaScript variable
- values. This will use some functions which were added
- with RKWard 0.6.1, and therefore raise the dependencies
- for your plugin/component accordingly. Nonetheless, it's
- recommended.}
+\item{guess.getter}{Logical,
+ if \code{TRUE} try to get a good default getter function for JavaScript
+variable values. This will use some functions which were added with RKWard 0.6.1,
+ and therefore
+raise the dependencies for your plugin/component accordingly. Nonetheless,
+ it's recommended.}
- \item{indent.by}{Character string used to indent each
- entry if \code{js=TRUE}.}
+\item{indent.by}{Character string used to indent each entry if \code{js=TRUE}.}
}
\value{
- A character vector.
+A character vector.
}
\description{
- Create JavaScript variables from plugin XML
+Create JavaScript variables from plugin XML
}
\seealso{
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.JS.vars.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.JS.vars.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.JS.vars.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.JS.vars}
\alias{rk.JS.vars}
\title{Define variables in JavaScript code}
@@ -2,52 +3,48 @@
\usage{
- rk.JS.vars(..., var.prefix = NULL, modifiers = NULL,
- default = FALSE, join = "", check.modifiers = TRUE,
- getter = "getValue", guess.getter = FALSE)
+rk.JS.vars(..., var.prefix = NULL, modifiers = NULL, default = FALSE,
+ join = "", check.modifiers = TRUE, getter = "getValue",
+ guess.getter = FALSE)
}
\arguments{
- \item{...}{Either one or more character strings (the
- names of the variables to define), or objects of class
- \code{XiMpLe.node} with plugin XML nodes (whose ID will
- be extracted and used).}
+\item{...}{Either one or more character strings (the names of the variables to define),
+or objects of class \code{XiMpLe.node} with plugin XML nodes (whose ID will be extracted and used).}
- \item{var.prefix}{A character string. will be used as a
- prefix for the JS variable names.}
+\item{var.prefix}{A character string. will be used as a prefix for the JS variable names.}
- \item{modifiers}{A character vector with modifiers you'd
- like to apply to the XML node property.}
+\item{modifiers}{A character vector with modifiers you'd like to apply to the XML node property.}
- \item{default}{Logical, if \code{TRUE} the default value
- (no special modifier) of the node will also be defined.
- Does nothing if \code{modifiers=NULL}.}
+\item{default}{Logical,
+ if \code{TRUE} the default value (no special modifier) of the node will
+also be defined. Does nothing if \code{modifiers=NULL}.}
- \item{join}{A character string, useful for GUI elements
- which accept multiple objects (i.e., multi-varslots). If
- \code{join} is something other than \code{""}, these
- objects will be collapsed into one string when pasted,
- joined by this string.}
+\item{join}{A character string,
+ useful for GUI elements which accept multiple objects (i.e., multi-varslots).
+If \code{join} is something other than \code{""},
+ these objects will be collapsed into one string when pasted,
+joined by this string.}
- \item{check.modifiers}{Logical, if \code{TRUE} the given
- modifiers will be checked for validity. Should only be
- turned off if you know what you're doing.}
+\item{check.modifiers}{Logical,
+ if \code{TRUE} the given modifiers will be checked for validity. Should only be
+turned off if you know what you're doing.}
- \item{getter}{A character string, naming the JavaScript
- function which should be used to get the values in the
- actual plugin. Depending on the XML element,
- \code{"getString"}, \code{"getBool"} or \code{"getList"}
- can be useful alternatives. For backwards compatibility,
- the default is set to \code{"getValue"}.}
+\item{getter}{A character string,
+ naming the JavaScript function which should be used to get the values in the
+actual plugin. Depending on the XML element, \code{"getString"},
+ \code{"getBool"} or \code{"getList"} can be
+useful alternatives. For backwards compatibility,
+ the default is set to \code{"getValue"}.}
- \item{guess.getter}{Logical, if \code{TRUE} try to get a
- good default getter function for JavaScript variable
- values.}
+\item{guess.getter}{Logical,
+ if \code{TRUE} try to get a good default getter function for JavaScript
+variable values.}
}
\value{
- An object of class \code{rk.JS.var}.
+An object of class \code{rk.JS.var}.
}
\description{
- Define variables in JavaScript code
+Define variables in JavaScript code
}
\note{
- To get a list of the implemented modifiers in this
- package, call \code{rkwarddev:::all.valid.modifiers}.
+To get a list of the implemented modifiers in this package,
+ call \code{rkwarddev:::all.valid.modifiers}.
}
@@ -62,10 +59,9 @@
cat(rk.paste.JS(rk.JS.vars(list(checkA, checkB, checkC))))
}
\seealso{
- \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
- \code{\link[rkwarddev:echo]{echo}},
- \code{\link[rkwarddev:id]{id}}, and the
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
+ \code{\link[rkwarddev:echo]{echo}},
+ \code{\link[rkwarddev:id]{id}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.XML.about.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.about.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.about.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.XML.about}
\alias{rk.XML.about}
\title{Create XML node "about" for RKWard pluginmaps}
@@ -2,80 +3,84 @@
\usage{
- rk.XML.about(name, author,
- about = list(desc = "SHORT_DESCRIPTION", version = "0.01-0", date = Sys.Date(),
- url = "http://EXAMPLE.com", license = "GPL (>= 3)", long.desc = NULL),
- dependencies = NULL, package = NULL, pluginmap = NULL)
+rk.XML.about(name, author, about = list(desc = "SHORT_DESCRIPTION", version =
+ "0.01-0", date = Sys.Date(), url = "http://EXAMPLE.com", license =
+ "GPL (>= 3)", long.desc = NULL), dependencies = NULL, package = NULL,
+ pluginmap = NULL)
}
\arguments{
- \item{name}{A character string with the plugin name.}
+\item{name}{A character string with the plugin name.}
- \item{author}{A vector of objects of class \code{person}
- with these elements (mandatory): \describe{
- \item{given}{Author given name} \item{family}{Author
- family name} \item{email}{Author mail address}
- \item{role}{This person's specific role, e.g.
- \code{"aut"} for actual author, \code{"cre"} for
- maintainer or \code{"ctb"} for contributor.} } See
- \code{\link[utils:person]{person}} for more details on
- this, especially for valid roles.}
+\item{author}{A vector of objects of class \code{person} with these elements (mandatory):
+\describe{
+ \item{given}{Author given name}
+ \item{family}{Author family name}
+ \item{email}{Author mail address}
+ \item{role}{This person's specific role, e.g. \code{"aut"} for actual author,
+ \code{"cre"} for maintainer or \code{"ctb"} for contributor.}
+}
+See \code{\link[utils:person]{person}} for more details on this,
+ especially for valid roles.}
- \item{about}{A named list with these elements: \describe{
+\item{about}{A named list with these elements:
+\describe{
\item{desc}{A short description (mandatory)}
\item{version}{Plugin version (mandatory)}
- \item{date}{Release date (mandatory)} \item{url}{URL for
- the plugin (optional)} \item{license}{License the plugin
- is distributed under (mandatory)} \item{category}{A
- category for this plugin (optional)} \item{long.desc}{A
- long description (optional, defaults to \code{desc})} }}
+ \item{date}{Release date (mandatory)}
+ \item{url}{URL for the plugin (optional)}
+ \item{license}{License the plugin is distributed under (mandatory)}
+ \item{category}{A category for this plugin (optional)}
+ \item{long.desc}{A long description (optional, defaults to \code{desc})}
+}}
- \item{dependencies}{A named list with these elements:
- \describe{ \item{rkward.min}{Minimum RKWard version
- needed for this plugin (optional)}
- \item{rkward.max}{Maximum RKWard version needed for this
- plugin (optional)} \item{R.min}{Minimum R version needed
- for this plugin (optional)} \item{R.max}{Maximum R
- version needed for this plugin (optional)} }}
+\item{dependencies}{A named list with these elements:
+\describe{
+ \item{rkward.min}{Minimum RKWard version needed for this plugin (optional)}
+ \item{rkward.max}{Maximum RKWard version needed for this plugin (optional)}
+ \item{R.min}{Minimum R version needed for this plugin (optional)}
+ \item{R.max}{Maximum R version needed for this plugin (optional)}
+}}
- \item{package}{A list of named character vectors, each
- with these elements: \describe{ \item{name}{Name of a
- package this plugin depends on (optional)}
+\item{package}{A list of named character vectors, each with these elements:
+\describe{
+ \item{name}{Name of a package this plugin depends on (optional)}
\item{min}{Minimum version of the package (optional)}
\item{max}{Maximum version of the package (optional)}
- \item{repository}{Repository to download the package
- (optional)} }}
+ \item{repository}{Repository to download the package (optional)}
+}}
- \item{pluginmap}{A named list with these elements:
- \describe{ \item{name}{Identifier of a pluginmap this
- plugin depends on (optional)} \item{url}{URL to get the
- pluginmap (optional)} }}
+\item{pluginmap}{A named list with these elements:
+\describe{
+ \item{name}{Identifier of a pluginmap this plugin depends on (optional)}
+ \item{url}{URL to get the pluginmap (optional)}
+}}
}
\description{
- Create XML node "about" for RKWard pluginmaps
+Create XML node "about" for RKWard pluginmaps
}
\examples{
about.node <- rk.XML.about(
- name="Square the circle",
- author=c(
- person(given="E.A.", family="Dölle",
- email="doelle at eternalwondermaths.example.org", role="aut"),
- person(given="A.", family="Assistant",
- email="alterego at eternalwondermaths.example.org", role=c("cre","ctb"))
- ),
- about=list(
- desc="Squares the circle using Heisenberg compensation.",
- version="0.1-3",
- date=Sys.Date(),
- url="http://eternalwondermaths.example.org/23/stc.html",
- license="GPL",
- category="Geometry"),
- dependencies=list(
- rkward.min="0.5.3",
- rkward.max="",
- R.min="2.10",
- R.max=""),
- package=list(
- c(name="heisenberg", min="0.11-2", max="",
- repository="http://rforge.r-project.org"),
- c(name="DreamsOfPi", min="0.2", max="", repository="")),
- pluginmap=list(
- c(name="heisenberg.pluginmap", url="http://eternalwondermaths.example.org/hsb"))
+ name="Square the circle",
+ author=c(
+ person(given="E.A.", family="Dölle",
+ email="doelle at eternalwondermaths.example.org", role="aut"),
+ person(given="A.", family="Assistant",
+ email="alterego at eternalwondermaths.example.org", role=c("cre","ctb"))
+ ),
+ about=list(
+ desc="Squares the circle using Heisenberg compensation.",
+ version="0.1-3",
+ date=Sys.Date(),
+ url="http://eternalwondermaths.example.org/23/stc.html",
+ license="GPL",
+ category="Geometry"),
+ dependencies=list(
+ rkward.min="0.5.3",
+ rkward.max="",
+ R.min="2.10",
+ R.max=""),
+ package=list(
+ c(name="heisenberg", min="0.11-2", max="",
+ repository="http://rforge.r-project.org"),
+ c(name="DreamsOfPi", min="0.2", max="", repository="")),
+ pluginmap=list(
+ c(name="heisenberg.pluginmap", url="http://eternalwondermaths.example.org/hsb"))
)
@@ -85,7 +90,6 @@
cat(pasteXML(about.node, shine=2))
}
\seealso{
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.XML.attribute.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.attribute.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.attribute.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.XML.attribute}
\alias{rk.XML.attribute}
\title{Create XML "attribute" node for RKWard plugins}
@@ -2,23 +3,18 @@
\usage{
- rk.XML.attribute(id, value = NULL, label = NULL)
+rk.XML.attribute(id, value = NULL, label = NULL)
}
\arguments{
- \item{id}{Either a character string (the \code{id} of the
- property whose attribute should be set), or an object of
- class \code{XiMpLe.node} (whose \code{id} will be
- extracted and used).}
+\item{id}{Either a character string (the \code{id} of the property whose attribute should be set),
+or an object of class \code{XiMpLe.node} (whose \code{id} will be extracted and used).}
- \item{value}{Character string, new value for the
- attribute.}
+\item{value}{Character string, new value for the attribute.}
- \item{label}{Character string, label associated with the
- attribute.}
+\item{label}{Character string, label associated with the attribute.}
}
\value{
- An object of class \code{XiMpLe.node}.
+An object of class \code{XiMpLe.node}.
}
\description{
- This function will create a attribute node for component
- sections in .pluginmap files. Only meaningful for import
- plugins.
+This function will create a attribute node for component sections in .pluginmap files.
+Only meaningful for import plugins.
}
@@ -32,8 +28,7 @@
cat(pasteXML(test.attribute))
}
\seealso{
- \code{\link[rkwarddev:rk.XML.components]{rk.XML.components}},
- and the \href{help:rkwardplugins}{Introduction to Writing
- Plugins for RKWard}
+\code{\link[rkwarddev:rk.XML.components]{rk.XML.components}},
+ and the \href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.XML.browser.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.browser.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.browser.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.XML.browser}
\alias{rk.XML.browser}
\title{Create XML node "browser" for RKWard plugins}
@@ -2,37 +3,31 @@
\usage{
- rk.XML.browser(label, type = "file", initial = NULL,
- urls = FALSE, filter = NULL, required = TRUE,
- id.name = "auto")
+rk.XML.browser(label, type = "file", initial = NULL, urls = FALSE,
+ filter = NULL, required = TRUE, id.name = "auto")
}
\arguments{
- \item{label}{Character string, a text label for this
- plugin element.}
+\item{label}{Character string, a text label for this plugin element.}
- \item{type}{Character string, valid values are "dir",
- "file" and "savefile" (i.e., an non-existing file).}
+\item{type}{Character string, valid values are "dir", "file" and "savefile" (i.e.,
+ an non-existing file).}
- \item{initial}{Character string, if not \code{NULL} will
- be used as the initial value of the browser.}
+\item{initial}{Character string,
+ if not \code{NULL} will be used as the initial value of the browser.}
- \item{urls}{Logical, whether non-local URLs are permitted
- or not.}
+\item{urls}{Logical, whether non-local URLs are permitted or not.}
- \item{filter}{Character vector, file type filter, e.g.
- \code{filter=c("*.txt", "*.csv")} for .txt and .csv
- files. Try not to induce limits unless absolutely
- needed, though.}
+\item{filter}{Character vector, file type filter, e.g. \code{filter=c("*.txt",
+ "*.csv")} for .txt and .csv files.
+Try not to induce limits unless absolutely needed, though.}
- \item{required}{Logical, whether an entry is mandatory or
- not.}
+\item{required}{Logical, whether an entry is mandatory or not.}
- \item{id.name}{Character string, a unique ID for this
- plugin element. If \code{"auto"} and a label was
- provided, an ID will be generated automatically from the
- label.}
+\item{id.name}{Character string, a unique ID for this plugin element.
+If \code{"auto"} and a label was provided,
+ an ID will be generated automatically from the label.}
}
\value{
- An object of class \code{XiMpLe.node}.
+An object of class \code{XiMpLe.node}.
}
\description{
- Create XML node "browser" for RKWard plugins
+Create XML node "browser" for RKWard plugins
}
@@ -43,7 +38,6 @@
cat(pasteXML(test.browser))
}
\seealso{
- \href{help:rkwardplugins}{Introduction to Writing Plugins
- for RKWard}
+\href{help:rkwardplugins}{Introduction to Writing Plugins for RKWard}
}
Modified: trunk/rkward/packages/rkwarddev/man/rk.XML.cbox.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.XML.cbox.Rd 2014-08-27 07:52:11 UTC (rev 4797)
+++ trunk/rkward/packages/rkwarddev/man/rk.XML.cbox.Rd 2014-09-01 13:31:28 UTC (rev 4798)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.1): do not edit by hand
\name{rk.XML.cbox}
\alias{rk.XML.cbox}
\alias{rk.XML.checkbox}
@@ -3,33 +4,27 @@
\title{Create XML node "checkbox" for RKWard plugins}
\usage{
- rk.XML.cbox(label, value = "true", un.value = NULL,
- chk = FALSE, id.name = "auto")
+rk.XML.cbox(label, value = "true", un.value = NULL, chk = FALSE,
+ id.name = "auto")
}
\arguments{
- \item{label}{Character string, a text label for this
- plugin element.}
+\item{label}{Character string, a text label for this plugin element.}
- \item{value}{Character string, the value to submit if the
- element is checked.}
+\item{value}{Character string, the value to submit if the element is checked.}
- \item{un.value}{Character string, an optional value for
- the unchecked option.}
+\item{un.value}{Character string, an optional value for the unchecked option.}
- \item{chk}{Logical, whether this element should be
- checked by default.}
+\item{chk}{Logical, whether this element should be checked by default.}
- \item{id.name}{Character string, a unique ID for this
- plugin element. If \code{"auto"}, an ID will be
- generated automatically from the label.}
+\item{id.name}{Character string, a unique ID for this plugin element.
+If \code{"auto"}, an ID will be generated automatically from the label.}
}
\value{
- An object of class \code{XiMpLe.node}.
+An object of class \code{XiMpLe.node}.
}
\description{
@@ Diff output truncated at 100000 characters. @@
More information about the rkward-tracker
mailing list