These functions use a DCT specification to generate a construct overview or an instruction overview.

generate_construct_overview(
  dctSpec,
  include = c("definition", "measure_dev", "measure_code", "manipulate_dev",
    "manipulate_code", "aspect_dev", "aspect_code", "rel"),
  hideByDefault = NULL,
  divClass = "btn btn-secondary",
  headingLevel = 3,
  collapseButtons = TRUE,
  hyperlink_UCIDs = TRUE,
  HTMLoutput = FALSE,
  urlPrefix = "#",
  sortDecreasing = FALSE
)

generate_definitions_overview(
  dctSpecDf,
  headingLevel = 3,
  hyperlink_UCIDs = "Markdown",
  urlPrefix = "#",
  sortDecreasing = FALSE
)

generate_instruction_overview(
  dctSpecDf,
  type,
  headingLevel = 3,
  hyperlink_UCIDs = "Markdown",
  urlPrefix = "#",
  sortDecreasing = FALSE
)

Arguments

dctSpec

The DCT specification, as resulting from a call to load_dct_specs() or load_dct_dir().

include

Which elements to include in the construct overview.

hideByDefault

Which elements to hide by default.

divClass

The class of the button to collapse/expand sections.

headingLevel

The level of the heading in the Markdown output that is produces.

collapseButtons

Whether to include buttons to show/hide the definition and instructions.

hyperlink_UCIDs

Whether to create hyperlinks to UCIDs.

HTMLoutput

Whether to output to Markdown (FALSE) or HTML (TRUE).

urlPrefix

The prefix to insert before the URL in the produced hyperlink. The default, "#", results in a link to an anchor (an HTML a element) on the current page.

sortDecreasing

Whether to sort the constructs in decreasing order (TRUE), in increasing order (FALSE), or not at all (NULL).

dctSpecDf

The DCT specification dataframer, as produced by a call to load_dct_specs() or load_dct_dir(), and stored within the resulting object.

type

For instruction overviews, the type of instruction to generate can be specified: must be one of "measure_dev", "measure_code", "manipulate_dev", "manipulate_code", "aspect_dev", or "aspect_code".

Value

A character string with the overview.

Examples

exampleDCT <-
  psyverse::dct_object(
    prefix = "exampleConstruct",
    label = "An example construct",
    definition = "The definition goes here",
    measure_dev = "Here you can explain how to measure the construct"
  );
generate_construct_overview(exampleDCT);
#>  [1] ""                                                                                                                                                                                                                                
#>  [2] "### An example construct {#exampleConstruct_7lyrwg97}"                                                                                                                                                                           
#>  [3] ""                                                                                                                                                                                                                                
#>  [4] "*This overview was generated on 2022-11-22 at 12:44:08 CET (GMT+0100)*"                                                                                                                                                          
#>  [5] ""                                                                                                                                                                                                                                
#>  [6] "This Decentralized Construct Taxonomy specification was authored at 2022-11-22."                                                                                                                                                 
#>  [7] ""                                                                                                                                                                                                                                
#>  [8] "Unique Construct Identifier (UCID): exampleConstruct_7lyrwg97"                                                                                                                                                                   
#>  [9] ""                                                                                                                                                                                                                                
#> [10] ""                                                                                                                                                                                                                                
#> [11] "#### Definition"                                                                                                                                                                                                                 
#> [12] "<div style=\"float:right;clear:both;margin:2px;border:2px solid #87C3FF;background-color:#c7e3ff;\" class=\"btn btn-secondary\" onclick=\"$(this).next('.toggleable').toggle()\">Show/hide definition</div>"                     
#> [13] ""                                                                                                                                                                                                                                
#> [14] "<div style='clear: both; display: block' class='toggleable'>"                                                                                                                                                                    
#> [15] "The definition goes here"                                                                                                                                                                                                        
#> [16] "</div>"                                                                                                                                                                                                                          
#> [17] "<div style='clear:both;height:2px;'></div>"                                                                                                                                                                                      
#> [18] ""                                                                                                                                                                                                                                
#> [19] ""                                                                                                                                                                                                                                
#> [20] "#### Instruction for developing measurement instruments"                                                                                                                                                                         
#> [21] "<div style=\"float:right;clear:both;margin:2px;border:2px solid #87C3FF;background-color:#c7e3ff;\" class=\"btn btn-secondary\" onclick=\"$(this).next('.toggleable').toggle()\">Show/hide measurement instruction</div>"        
#> [22] ""                                                                                                                                                                                                                                
#> [23] "<div style='clear: both; display: block' class='toggleable'>"                                                                                                                                                                    
#> [24] "Here you can explain how to measure the construct"                                                                                                                                                                               
#> [25] "</div>"                                                                                                                                                                                                                          
#> [26] "<div style='clear:both;height:2px;'></div>"                                                                                                                                                                                      
#> [27] ""                                                                                                                                                                                                                                
#> [28] ""                                                                                                                                                                                                                                
#> [29] "#### Instruction for coding measurement instruments"                                                                                                                                                                             
#> [30] "<div style=\"float:right;clear:both;margin:2px;border:2px solid #87C3FF;background-color:#c7e3ff;\" class=\"btn btn-secondary\" onclick=\"$(this).next('.toggleable').toggle()\">Show/hide measurement coding instruction</div>" 
#> [31] ""                                                                                                                                                                                                                                
#> [32] "<div style='clear: both; display: block' class='toggleable'>"                                                                                                                                                                    
#> [33] ""                                                                                                                                                                                                                                
#> [34] "</div>"                                                                                                                                                                                                                          
#> [35] "<div style='clear:both;height:2px;'></div>"                                                                                                                                                                                      
#> [36] ""                                                                                                                                                                                                                                
#> [37] ""                                                                                                                                                                                                                                
#> [38] "#### Instruction for developing manipulations"                                                                                                                                                                                   
#> [39] "<div style=\"float:right;clear:both;margin:2px;border:2px solid #87C3FF;background-color:#c7e3ff;\" class=\"btn btn-secondary\" onclick=\"$(this).next('.toggleable').toggle()\">Show/hide manipulation instruction</div>"       
#> [40] ""                                                                                                                                                                                                                                
#> [41] "<div style='clear: both; display: block' class='toggleable'>"                                                                                                                                                                    
#> [42] "*Not specified*"                                                                                                                                                                                                                 
#> [43] "</div>"                                                                                                                                                                                                                          
#> [44] "<div style='clear:both;height:2px;'></div>"                                                                                                                                                                                      
#> [45] ""                                                                                                                                                                                                                                
#> [46] ""                                                                                                                                                                                                                                
#> [47] "#### Instruction for coding manipulations"                                                                                                                                                                                       
#> [48] "<div style=\"float:right;clear:both;margin:2px;border:2px solid #87C3FF;background-color:#c7e3ff;\" class=\"btn btn-secondary\" onclick=\"$(this).next('.toggleable').toggle()\">Show/hide manipulation coding instruction</div>"
#> [49] ""                                                                                                                                                                                                                                
#> [50] "<div style='clear: both; display: block' class='toggleable'>"                                                                                                                                                                    
#> [51] "*Not specified*"                                                                                                                                                                                                                 
#> [52] "</div>"                                                                                                                                                                                                                          
#> [53] "<div style='clear:both;height:2px;'></div>"                                                                                                                                                                                      
#> [54] ""                                                                                                                                                                                                                                
#> [55] ""                                                                                                                                                                                                                                
#> [56] "#### Instruction for developing aspects"                                                                                                                                                                                         
#> [57] "<div style=\"float:right;clear:both;margin:2px;border:2px solid #87C3FF;background-color:#c7e3ff;\" class=\"btn btn-secondary\" onclick=\"$(this).next('.toggleable').toggle()\">Show/hide aspect elicitation instruction</div>" 
#> [58] ""                                                                                                                                                                                                                                
#> [59] "<div style='clear: both; display: block' class='toggleable'>"                                                                                                                                                                    
#> [60] ""                                                                                                                                                                                                                                
#> [61] "</div>"                                                                                                                                                                                                                          
#> [62] "<div style='clear:both;height:2px;'></div>"                                                                                                                                                                                      
#> [63] ""                                                                                                                                                                                                                                
#> [64] ""                                                                                                                                                                                                                                
#> [65] "#### Instruction for coding aspects"                                                                                                                                                                                             
#> [66] "<div style=\"float:right;clear:both;margin:2px;border:2px solid #87C3FF;background-color:#c7e3ff;\" class=\"btn btn-secondary\" onclick=\"$(this).next('.toggleable').toggle()\">Show/hide aspect coding instruction</div>"      
#> [67] ""                                                                                                                                                                                                                                
#> [68] "<div style='clear: both; display: block' class='toggleable'>"                                                                                                                                                                    
#> [69] "*When coding aspects, use the following code: **`dct:exampleConstruct_7lyrwg97`***"                                                                                                                                              
#> [70] ""                                                                                                                                                                                                                                
#> [71] ""                                                                                                                                                                                                                                
#> [72] "</div>"                                                                                                                                                                                                                          
#> [73] "<div style='clear:both;height:2px;'></div>"                                                                                                                                                                                      
#> [74] ""                                                                                                                                                                                                                                
#> [75] "#### Relationships with other constructs"                                                                                                                                                                                        
#> [76] ""                                                                                                                                                                                                                                
#> [77] "*Not specified*"                                                                                                                                                                                                                 
#> [78] ""