View source: R/rk.plugin.skeleton.R
rk.plugin.skeleton | R Documentation |
With this function you can write everything from a basic skeleton structure to a complete functional plugin,
including several
components/dialogs. You should always define one main component (by xml
, js
,
rkh
etc.) before you provide
additional features by components
.
rk.plugin.skeleton( about, path = tempdir(), provides = c("logic", "dialog"), scan = c("var", "saveobj", "settings", "preview"), unused.vars = FALSE, guess.getter = FALSE, xml = list(), js = list(), pluginmap = list(), rkh = list(), overwrite = FALSE, tests = TRUE, lazyLoad = TRUE, create = c("pmap", "xml", "js", "rkh", "desc", "clog"), suggest.required = TRUE, components = list(), dependencies = NULL, edit = FALSE, load = FALSE, show = FALSE, gen.info = TRUE, hints = TRUE, indent.by = rk.get.indent(), internal = FALSE )
about |
Either an object of class |
path |
Character sting, path to the main directory where the skeleton should be created. |
provides |
Character vector with possible entries of |
scan |
A character vector to trigger various automatic scans of the generated GUI XML file. Valid enties are:
|
unused.vars |
Logical,
if |
guess.getter |
Logical,
if |
xml |
A named list of options to be forwarded to |
js |
A named list of options to be forwarded to |
pluginmap |
A named list of options to be forwarded to |
rkh |
A named list of options to be forwarded to |
overwrite |
Logical,
whether existing files should be replaced. Defaults to |
tests |
Logical, whether directories and files for plugin tests should be created.
Defaults to |
lazyLoad |
Logical,
whether the package should be prepared for lazy loading or not. Should be left |
create |
A character vector with one or more of these possible entries:
Default is to create all of these files. Existing files will only be overwritten if |
suggest.required |
Logical,
if |
components |
A list of plugin components. See |
dependencies |
An object of class |
edit |
Logical,
if |
load |
Logical, if |
show |
Logical, if |
gen.info |
Logical,
if |
hints |
Logical,
if |
indent.by |
A character string defining the indentation string to use. |
internal |
Logical,
a simple switch to build an internal plugin for official distribution with RKWard. If set to
|
Character string with the path to the plugin root directory.
Introduction to Writing Plugins for RKWard
## Not run: # a simple example with only basic information about.info <- rk.XML.about( name="Square the circle", author=c( person(given="E.A.", family="Dölle", email="doelle@eternalwondermaths.example.org", role="aut"), person(given="A.", family="Assistant", email="alterego@eternalwondermaths.example.org", role=c("cre","ctb")) )) rk.plugin.skeleton(about.info) # a more complex example, already including some dialog elements about.info <- rk.XML.about( name="Square the circle", author=c( person(given="E.A.", family="Dölle", email="doelle@eternalwondermaths.example.org", role="aut"), person(given="A.", family="Assistant", email="alterego@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")) ) test.dropdown <- rk.XML.dropdown("mydrop", opts=list("First Option"=c(val="val1"), "Second Option"=c(val="val2", chk=TRUE))) test.checkboxes <- rk.XML.row(rk.XML.col( list(test.dropdown, rk.XML.cbox(label="foo", val="foo1", chk=TRUE), rk.XML.cbox(label="bar", val="bar2")) )) test.vars <- rk.XML.vars("select some vars", "vars go here") test.tabbook <- rk.XML.dialog(rk.XML.tabbook("My Tabbook", tab.labels=c("First Tab", "Second Tab"), children=list(test.checkboxes, test.vars))) rk.plugin.skeleton(about.info, xml=list(dialog=test.tabbook), overwrite=TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.