Show all coded fragments

resultsOverview_allCodedFragments(
  x,
  root = "codes",
  context = 0,
  heading = NULL,
  headingLevel = 2,
  add_html_tags = TRUE,
  cleanUtterances = FALSE,
  output = NULL,
  outputViewer = "viewer",
  template = "default",
  includeCSS = TRUE,
  includeBootstrap = rock::opts$get("includeBootstrap"),
  preventOverwriting = rock::opts$get(preventOverwriting),
  silent = rock::opts$get(silent)
)

Arguments

x

The parsed source(s) as provided by rock::parse_source or rock::parse_sources.

root

The root code

context

How many utterances before and after the target utterances to include in the fragments. If two values, the first is the number of utterances before, and the second, the number of utterances after the target utterances.

heading

Optionally, a title to include in the output. The title will be prefixed with headingLevel hashes (#), and the codes with headingLevel+1 hashes. If NULL (the default), a heading will be generated that includes the collected codes if those are five or less. If a character value is specified, that will be used. To omit a heading, set to anything that is not NULL or a character vector (e.g. FALSE). If no heading is used, the code prefix will be headingLevel hashes, instead of headingLevel+1 hashes.

headingLevel

The number of hashes to insert before the headings.

add_html_tags

Whether to add HTML tags to the result.

cleanUtterances

Whether to use the clean or the raw utterances when constructing the fragments (the raw versions contain all codes). Note that this should be set to FALSE to have add_html_tags be of the most use.

output

Here, a path and filename can be provided where the result will be written. If provided, the result will be returned invisibly.

outputViewer

If showing output, where to show the output: in the console (outputViewer='console') or in the viewer (outputViewer='viewer'), e.g. the RStudio viewer. You'll usually want the latter when outputting HTML, and otherwise the former. Set to FALSE to not output anything to the console or the viewer.

template

The template to load; either the name of one of the ROCK templates (currently, only 'default' is available), or the path and filename of a CSS file.

includeCSS

Whether to include the ROCK CSS in the returned HTML.

includeBootstrap

Whether to include the default bootstrap CSS.

preventOverwriting

Whether to prevent overwriting of output files.

silent

Whether to provide (FALSE) or suppress (TRUE) more detailed progress updates.

Value

Invisibly, the coded fragments in a character vector.

Examples

### Get path to example source
examplePath <-
  system.file("extdata", package="rock");

### Get a path to one example file
exampleFile <-
  file.path(
    examplePath, "example-1.rock"
  );

### Parse single example source
parsedExample <-
  rock::parse_source(
    exampleFile
  );

### Show organised coded fragments in Markdown
cat(
  rock::resultsOverview_allCodedFragments(
    parsedExample
  )
);
#> 
#> 
#> ### Code: `parentCode1`
#> 
#>  
#> 
#> #### Code: `childCode1`
#> 
#>  <h4>Collected coded fragments for codes 'childCode1' with 0 lines of context</h4>
#> 
#> ##### childCode1 *(path: childCode1)*
#> 
#> -----
#> 
#> <div class="utterance">Lorem Ipsum is simply dummy text of the printing and typesetting industry. <span class="code codes">[[parentCode1&gt;childCode1]]</span></div>
#> 
#> 
#> -----
#> 
#> <div class="utterance">~specimen book. <span class="code codes">[[parentCode1&gt;childCode2]]</span> <span class="code codes">[[childCode1]]</span> <span class="codeValue codeValues">[[intensity||2]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ##### Code: `grandchildCode1`
#> 
#>  <h5>Collected coded fragments for codes 'grandchildCode1' with 0 lines of context</h5>
#> 
#> ###### grandchildCode1 *(path: parentCode1>childCode1>grandchildCode1)*
#> 
#> -----
#> 
#> <div class="utterance">using 'Content here, content here', making it look like readable English. <span class="code codes">[[parentCode1&gt;childCode1&gt;grandchildCode1]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ##### Code: `grandchildCode2`
#> 
#>  <h5>Collected coded fragments for codes 'grandchildCode2' with 0 lines of context</h5>
#> 
#> ###### grandchildCode2 *(path: childCode1>grandchildCode2)*
#> 
#> -----
#> 
#> <div class="utterance">~still in their infancy. <span class="code codes">[[parentCode1&gt;childCode1&gt;grandchildCode2]]</span></div>
#> 
#> 
#> -----
#> 
#> <div class="utterance">accompanied by English versions from the 1914 translation by H. Rackham. <span class="code codes">[[childCode1&gt;grandchildCode2]]</span></div>
#> 
#> 
#> -----
#> 
#> <div class="utterance">reasonable. The generated Lorem Ipsum is therefore always free from <span class="code codes">[[grandchildCode2]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ##### Code: `grandchildCode3`
#> 
#>  <h5>Collected coded fragments for codes 'grandchildCode3' with 0 lines of context</h5>
#> 
#> ###### grandchildCode3 *(path: parentCode1>childCode1>grandchildCode3)*
#> 
#> -----
#> 
#> <div class="utterance">by accident, sometimes on purpose (injected humour and the like). <span class="code codes">[[parentCode1&gt;childCode1&gt;grandchildCode3]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> #### Code: `childCode2`
#> 
#>  <h4>Collected coded fragments for codes 'childCode2' with 0 lines of context</h4>
#> 
#> ##### childCode2 *(path: parentCode1>childCode2)*
#> 
#> -----
#> 
#> <div class="utterance">~specimen book. <span class="code codes">[[parentCode1&gt;childCode2]]</span> <span class="code codes">[[childCode1]]</span> <span class="codeValue codeValues">[[intensity||2]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> #### Code: `childCode3`
#> 
#>  <h4>Collected coded fragments for codes 'childCode3' with 0 lines of context</h4>
#> 
#> ##### childCode3 *(path: parentCode1>childCode3)*
#> 
#> -----
#> 
#> <div class="utterance">~~electronic typesetting, remaining essentially unchanged. <span class="code codes">[[parentCode1&gt;childCode3]]</span> <span class="code codes">[[someOtherCode]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ### Code: `parentCode2`
#> 
#>  
#> 
#> #### Code: `childCode4`
#> 
#>  <h4>Collected coded fragments for codes 'childCode4' with 0 lines of context</h4>
#> 
#> ##### childCode4 *(path: parentCode2>childCode4)*
#> 
#> -----
#> 
#> <div class="utterance">~~including versions of Lorem Ipsum. <span class="code codes">[[parentCode2&gt;childCode4]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ##### Code: `grandchildCode4`
#> 
#>  <h5>Collected coded fragments for codes 'grandchildCode4' with 0 lines of context</h5>
#> 
#> ###### grandchildCode4 *(path: parentCode2>childCode4>grandchildCode4)*
#> 
#> -----
#> 
#> <div class="utterance">Where does it come from? <span class="code codes">[[parentCode2&gt;childCode4&gt;grandchildCode4]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ##### Code: `grandchildCode5`
#> 
#>  <h5>Collected coded fragments for codes 'grandchildCode5' with 0 lines of context</h5>
#> 
#> ###### grandchildCode5 *(path: parentCode2>childCode4>grandchildCode5)*
#> 
#> -----
#> 
#> <div class="utterance">old.  <span class="code codes">[[parentCode2&gt;childCode4&gt;grandchildCode5]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ##### Code: `grandchildCode6`
#> 
#>  <h5>Collected coded fragments for codes 'grandchildCode6' with 0 lines of context</h5>
#> 
#> ###### grandchildCode6 *(path: parentCode2>childCode4>grandchildCode6)*
#> 
#> -----
#> 
#> <div class="utterance">discovered the undoubtable source. <span class="code codes">[[parentCode2&gt;childCode4&gt;grandchildCode6]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> #### Code: `childCode5`
#> 
#>  <h4>Collected coded fragments for codes 'childCode5' with 0 lines of context</h4>
#> 
#> ##### childCode5 *(path: parentCode2>childCode5)*
#> 
#> -----
#> 
#> <div class="utterance">content of a page when looking at its layout. <span class="code codes">[[parentCode2&gt;childCode5]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ##### Code: `grandchildCode7`
#> 
#>  <h5>Collected coded fragments for codes 'grandchildCode7' with 0 lines of context</h5>
#> 
#> ###### grandchildCode7 *(path: childCode5>grandchildCode7)*
#> 
#> -----
#> 
#> <div class="utterance">repetition, injected humour, or non-characteristic words etc. <span class="code codes">[[childCode5&gt;grandchildCode7]]</span></div>
#> 
#> 
#> -----
#> 
#>  
#> 
#> ### Code: `someOtherCode`
#> 
#>  <h3>Collected coded fragments for codes 'someOtherCode' with 0 lines of context</h3>
#> 
#> #### someOtherCode *(path: someOtherCode)*
#> 
#> -----
#> 
#> <div class="utterance">~~electronic typesetting, remaining essentially unchanged. <span class="code codes">[[parentCode1&gt;childCode3]]</span> <span class="code codes">[[someOtherCode]]</span></div>
#> 
#> 
#> -----
#>