This function adds HTML tags to a source to allow pretty printing/viewing.
Usage
add_html_tags(
x,
context = NULL,
codeClass = rock::opts$get("codeClass"),
codeValueClass = rock::opts$get("codeValueClass"),
networkCodeClass = rock::opts$get("networkCodeClass"),
idClass = rock::opts$get("idClass"),
sectionClass = rock::opts$get("sectionClass"),
uidClass = rock::opts$get("uidClass"),
contextClass = rock::opts$get("contextClass"),
rockLineClass = rock::opts$get("rockLineClass"),
utteranceClass = rock::opts$get("utteranceClass"),
codingClass = rock::opts$get("codingClass"),
commentClass = rock::opts$get("commentClass"),
yamlClass = rock::opts$get("yamlClass")
)
Arguments
- x
A character vector with the source
- context
Optionally, lines to pass the contextClass
- codeClass, codeValueClass, idClass, sectionClass, uidClass, contextClass, utteranceClass, commentClass, networkCodeClass, rockLineClass, codingClass, yamlClass
The classes to use for, respectively, codes, code values, class instance identifiers (such as case identifiers or coder identifiers), section breaks, utterance identifiers, context, full utterances, comments, network codes, source lines, codings, and YAML chunks. All
<span>
elements except for the full utterances, which are placed in<div>
elements.
Examples
### Add tags to a mini example source
add_html_tags("[[cid=participant1]]
This is something this participant may have said.
Just like this. [[thisIsACode]]
---paragraph-break---
And another utterance.");
#> [1] "<div class=\"rock-line rock-utterance utterance\"><span class=\"rock-ciid identifier ciid\">[[cid=participant1]]</span>\nThis is something this participant may have said.\nJust like this. <span class=\"rock-coding rock-treeCode code codes\">[[thisIsACode]]</span>\n---paragraph-break---\nAnd another utterance.</div>\n"