writeTags: Replace tags within a TiddlyWiki file.

Description Usage Arguments Details Author(s) See Also Examples

Description

The function replaces one or more tags within a TiddlyWiki template file. It is intended to insert the results of the analysis within already existing tiddlers.

Usage

1
2
writeTags(x, tag = names(x), rep = x, file, infile = file,
  outfile = file, verbose = TRUE)

Arguments

x

a list

tag

a character vector containing the tags to be replaced.

rep

a list of the objects that will replace each tag.

file

TiddlyWiki template file.

infile

template file.

outfile

output file if required to be different from the input file.

verbose

verbose.

Details

A list with the tags to be replaced in its 'names' and the replacement objects in its 'elements' is required by the function.

Alternatively a character vector of tags and a list of replacements objects may be provided. When there is just one tag to be replaced 'x' or 'rep' may not be wrapped into the list structure; 'x' would be then a character vector of length one and 'rep' may be any object in R.

By default the TiddlyWiki template "file" will be overwritten. The options "infile" and "outfile" may be used not to overwrite the template.

A recommendation is to use something like @this_is_my_tag@ as a 'tag' to be replaced. This character string is generally unique so there Will not be any problem in overwriting it. Also the @ indicates a highlight in the TiddlyWiki syntax so you will track your tags easily in your writing.

Author(s)

David Montaner dmontaner@cipf.es

See Also

writeTiddlers, wikify, gsub

Examples

1
2
3
4
## Not run: 
  writeTags (x, tag = names (x), rep = x, file = "myTemplate.html")

## End(Not run)

dmontaner/TiddlyWikiR documentation built on May 15, 2019, 9:35 a.m.