If you want to write a help page for your plugin, the most straight forward way to do so is to add the particular instructions directly to the definitions of the XML elements they belong to:
variables <- rk.XML.varselector( id.name="vars", help="Select the data object you would like to analyse.", component="Data" )
The text given to the help
parameter can then be fetched by rk.rkh.scan()
and written to the help page of this plugin component. For this to work technically, however, rk.rkh.scan()
must know which R objects belong to one plugin component. This is why you must also provide the component
parameter and make sure it is identical for all objects belonging together.
Since you will usually combine many objects into one dialog and might also like to be able to re-use objects like the <varslot> in multiple components of your plugins, it is possible to globally define a component with the rk.set.comp()
. If set, it is assumed that all the following objects used in your script belong to that particular component, until rk.set.comp()
is being called again with a different component name. You can then omit the component
parameter:
rk.set.comp("Data") variables <- rk.XML.varselector( id.name="vars", help="Select the data object you would like to analyse." )
To add global sections like <summary> or <usage> to the help page, you use functions like rk.rkh.summary()
or rk.rkh.usage()
accordingly. Their results are then used to set the list elements like summary
or usage
in the rkh
parameter of rk.plugin.component()
/rk.plugin.skeleton()
.