Takes an onbrand object with a loaded template and displays details about the template. For PowerPoint this contains the template names and elements present for that template. For Word it will contain defined text and table styles. This informaiton can be displayed in the console, returned as text or formatted for use in RMarkdown documentation.

template_details(obnd, verbose = TRUE)

Arguments

obnd

onbrand report object

verbose

Boolean variable when set to TRUE (default) messages will be displayed on the terminal; Messages will be included in the returned results object.

Value

list with the following elements:

  • rpttype: Type of report (either PowerPoint or Word)

  • msgs: Vector of messages with details or any errors that were encountered

  • txt: Vector of tempalte details in text format

  • df: Vector of tempalte details in a dataframe

  • ft: Vector of tempalte details in flextable format

  • isgood: Boolean variable indicating the current state of the object

Examples

obnd = read_template(
   template = file.path(system.file(package="onbrand"), "templates", "report.pptx"),
   mapping  = file.path(system.file(package="onbrand"), "templates", "report.yaml"))
details = template_details(obnd)
#> Mapping:     /private/var/folders/9x/kwnn6qj93c122hwdlp5hrrnc0000gn/T/RtmpOKlrqg/temp_libpathd7fbcbbb6e/onbrand/templates/report.yaml
#> Report Type: PowerPoint
#> title_slide (master/template)
#>   > title (text)
#>   > sub_title (text)
#> section_slide (master/template)
#>   > title (text)
#>   > sub_title (text)
#> title_only (master/template)
#>   > title (text)
#> content_text (master/template)
#>   > title (text)
#>   > sub_title (text)
#>   > content_body (text)
#> content_list (master/template)
#>   > title (text)
#>   > sub_title (text)
#>   > content_body (list)
#> two_content_header_list (master/template)
#>   > title (text)
#>   > sub_title (text)
#>   > content_left_header (text)
#>   > content_left (list)
#>   > content_right_header (text)
#>   > content_right (list)
#> two_content_header_text (master/template)
#>   > title (text)
#>   > sub_title (text)
#>   > content_left_header (text)
#>   > content_left (text)
#>   > content_right_header (text)
#>   > content_right (text)
#> two_content_list (master/template)
#>   > title (text)
#>   > sub_title (text)
#>   > content_left (list)
#>   > content_right (list)
#> two_content_text (master/template)
#>   > title (text)
#>   > sub_title (text)
#>   > content_left (text)
#>   > content_right (text)

obnd = read_template(
   template = file.path(system.file(package="onbrand"), "templates", "report.docx"),
   mapping  = file.path(system.file(package="onbrand"), "templates", "report.yaml"))
details = template_details(obnd)
#> Mapping:     /private/var/folders/9x/kwnn6qj93c122hwdlp5hrrnc0000gn/T/RtmpOKlrqg/temp_libpathd7fbcbbb6e/onbrand/templates/report.yaml
#> Report Type: Word
#>   onbrand style (word style, style type)
#>   --------------------------------------
#>   Code (Code, paragraph)
#>   Figure_Caption (graphic title, paragraph)
#>   Heading_1 (heading 1, paragraph)
#>   Heading_2 (heading 2, paragraph)
#>   Heading_3 (heading 3, paragraph)
#>   Normal (Normal, paragraph)
#>   TOC (toc 1, paragraph)
#>   Table_Caption (table title, paragraph)
#>   Table (Table Grid, table)