modify_property | R Documentation |
This is a package internal function used to modify a task given an input and a task to be modified. Because the tasks all are simple textual strings, modification is implemented by text substitution and then re-parsing of the task.
The function presumes that all modifications of properties can be based on strings like "prop:value" (wherein underscores represent a space). Thus, strictly speaking, tags are not properties of a task.
To implement a degree of flexibility in how to specify properties and
values, prop
defaults to NULL so that value
can (also) be used to
specify new values as prop:value
.
Also in view of flexibility, the function presumes that the user ensures to maintain the todo.txt specification. So no checking is done to ascertain whether a property is a valid property of the (original) specification.
Note that setting the property (of which always only one should exist
in any given task) and new value suitable also enables deleting
properties from a task. For instance, modify_property(task, "due:", "")
removes the due date from a task. Does not work yet.
modify_property(task, prop = NULL, value)
task |
A string with one (or, as vector, one or more) task(s) that follow(s) the todo.txt specification by Gina Trapani. When multiple tasks are provided, all tasks are modified in the same way. |
prop |
Identifier of the property of the task (a string). Can be
postfixed with a colon (e.g. "due:" instead of "due"). Defaults to
NULL implying that then |
value |
New value for the property (a string). |
The updated task(s)
Paul Lemmens (paul.lemmens@gmail.com)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.