Description Details YAML syntax Processing YAML markup Identifying/retrieving YAML markup Parsing YAML markup Building expressions from YAML markup Update original object that contained YAML markup Classes and constructors Author(s) References
Useful functionality to identify, parse and process YAML markup.
The package aims at providing a general interface for processing YAML
markup in a flexible and extendable manner based on the
S4 Methods
mechanism.
To realize a generic approach, the basic workflow method
getYaml
takes two arguments:
from
:
An object containing YAML markup
ctx
:
An object denoting the application context.
Currently available contexts:
YamlContext.ObjectReference.S3
Note that the YAML statement for specifying object references must be as follows:
object-ref: {id: {id}, where: {where}, as: {id-ref}}
Note that elements where
and as
are optional and that spaces
are required between each syntax component. While the lack of spaces will
cause a parsing error in yaml.load
, additional spaces
do not casue any trouble.
Example for valid YAML statements
object-ref: {id: x_1, where: .GlobalEnv, as: ref_1}
object-ref: {id: x_1, where: .GlobalEnv}
object-ref: {id: x_1}
object-ref: { id: x_1, where : .GlobalEnv, as: ref_1 }
See the official http://www.yaml.org/ for more details about YAML
Function processYaml
:
This is the main top-level function for using this package. It is wrapper around the sequential execution of
getYaml
parseYaml
buildExpressionFromYaml
updateYamlSource
Takes an object that contains YAML markup and then processes it eventually resulting in updating the underlying object so that it can be used/executed.
Currently available methods:
processYaml-function-YamlContext.ObjectReference.S3-method
:
Returns instance of class ObjectReferenceYamlProcessed.S3
.
Function getYaml
:
Takes an object that contains YAML markup and then tries to identify and retrieve the actual markup.
Currently available methods:
getYaml-function-YamlContext.ObjectReference.S3-method
:
Returns instance of class ObjectReferenceYaml.S3
.
Function parseYaml
:
Takes an object as returned by getYaml
and parses it.
Currently available methods:
parseYaml-ObjectReferenceYaml.S3-method
:
Returns instance of class ObjectReferenceYamlParsed.S3
.
Function buildExpressionFromYaml
:
Takes an object as returned by parseYaml
and builds suitable expressions based on the provided YAML markup.
Currently available methods:
buildExpressionFromYaml-ObjectReferenceYamlParsed.S3-method
:
Returns instance of class ObjectReferenceYamlProcessed.S3
.
Function updateYamlSource
:
Takes an object as returned by buildExpressionFromYaml
and updates the underlying source object in order to substitute the
YAML markup by suitable expressions to make the object fully self-contained.
Currently available methods:
updateYamlSource-ObjectReferenceYamlProcessed.S3-method
:
Returns instance of class ObjectReferenceYamlProcessed.S3
.
The object in field src
can be used/evaluated as all YAML markup
as expected by the application context (see details)
has been substituted by actual expressions.
The package defines the following S3 classes (in order of their workflow usage):
YamlContext.ObjectReference.S3
ObjectReferenceYaml.S3
ObjectReferenceYamlParsed.S3
ObjectReferenceYamlProcessed.S3
NOTE
S3 classes are generally used for speeding up rapid prototyping. It is possible
that these classes are transformed to actual S4
classes at some point
Janko Thyson janko.thyson@rappster.de
http://github.com/Rappster/yamlr
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.