rk.JS.saveobj: Create JavaScript saveobject code from plugin XML

View source: R/rk.JS.saveobj.R

rk.JS.saveobjR Documentation

Create JavaScript saveobject code from plugin XML

Description

Create JavaScript saveobject code from plugin XML

Usage

rk.JS.saveobj(
  pXML,
  R.objects = "initial",
  vars = TRUE,
  add.abbrev = FALSE,
  preview = FALSE,
  indent.by = rk.get.indent(),
  level = 2
)

Arguments

pXML

Either an object of class XiMpLe.doc or XiMpLe.node, or path to a plugin XML file.

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 intital attribute values of the nodes are used.

vars

Logocal, whether the variables needed should also be defined in the JavaScript code.

add.abbrev

Logical, if 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.

preview

Logical, whether to prepare the JS code to be used in plugins with preview functionality, i.e., do not save objects while preview is active.

indent.by

Character string used to indent each entry if js=TRUE.

level

Integer, which indentation level to use, minimum is 1.

Value

A character vector.

See Also

Introduction to Writing Plugins for RKWard


rkward-community/rkwarddev documentation built on May 9, 2022, 3:02 p.m.