Package 'unhcrdown'

Title: UNHCR Branded Templates for R Markdown Documents
Description: Create United Nations High Commissioner for Refugees (UNHCR) branded documents, presentations, and reports using R Markdown templates. This package provides customized formats that align with UNHCR's official brand guidelines for creating professional PDF reports, Word documents, PowerPoint presentations, and HTML outputs.
Authors: Cédric Vidonne [aut, cre], Ahmadou Dicko [aut], Edouard Legoupil [aut], UNHCR [cph]
Maintainer: Cédric Vidonne <[email protected]>
License: MIT + file LICENSE
Version: 0.6.0.9000
Built: 2025-02-17 06:02:18 UTC
Source: https://github.com/unhcr-dataviz/unhcrdown

Help Index


Convert to UNHCR branded Word document

Description

Format for converting from R Markdown to an UNHCR branded Word simple document

Usage

docx_simple(...)

Arguments

...

extra parameters to pass to officedown::rdocx_document

Value

An R Markdown output format.

Examples

## Not run: 
# Requires pandoc

# Create an R Markdown example file
rmd_content <- "---
 title: 'Example UNHCR Word Document'
 output: unhcrdown::docx_simple
 ---

 ## Introduction

 This is an example of a UNHCR-branded Word document created using `unhcrdown::docx_simple`.
 "

# Write the R Markdown content to a file
example_file <- tempfile(fileext = ".Rmd")
writeLines(rmd_content, example_file)

# Render the R Markdown file
rmarkdown::render(example_file,
  output_format = unhcrdown::docx_simple(),
  output_dir = tempdir()
)

## End(Not run)

Convert to UNHCR branded HTML website

Description

Format for converting from R Markdown to an UNHCR branded HTML website

Usage

html_page(...)

Arguments

...

extra parameters to pass to rmarkdown::html_document

Value

An R Markdown output format.

Examples

## Not run: 
# Requires pandoc

# Create an R Markdown example file
rmd_content <- "---
 title: 'Example UNHCR HTML Page'
 output: unhcrdown::html_page
 ---

 ## Introduction

 This is an example of a UNHCR-branded HTML page created using `unhcrdown::html_page`.
 "

# Write the R Markdown content to a file
example_file <- tempfile(fileext = ".Rmd")
writeLines(rmd_content, example_file)

# Render the R Markdown file
rmarkdown::render(example_file,
  output_format = unhcrdown::html_page(),
  output_dir = tempdir()
)

# View the rendered HTML file
browseURL(render_file)

## End(Not run)

Convert to UNHCR branded HTML presentation

Description

Format for converting from R Markdown to an UNHCR branded HTML presentation

Usage

html_slides(other_css = NULL, ...)

Arguments

other_css

Add extra css

...

extra parameters to pass to xaringan::moon_reader

Value

An R Markdown output format.

Examples

## Not run: 
# Requires pandoc

# Create an R Markdown example file
rmd_content <- "---
 title: 'Example UNHCR HTML Slides'
 output: unhcrdown::html_slides
 ---

 ## Introduction

 This is an example of a UNHCR-branded HTML slides created using `unhcrdown::html_slides`.
 "

# Write the R Markdown content to a file
example_file <- tempfile(fileext = ".Rmd")
writeLines(rmd_content, example_file)

# Render the R Markdown file
rmarkdown::render(example_file,
  output_format = unhcrdown::html_slides(),
  output_dir = tempdir()
)

# View the rendered HTML file
browseURL(render_file)

## End(Not run)

Function for UNHCR paged report template

Description

Function for UNHCR paged report template

Usage

paged_report(
  front_img = NULL,
  img_to_dark = FALSE,
  other_css = NULL,
  toc = TRUE,
  toc_depth = 2,
  number_sections = FALSE,
  ...
)

Arguments

front_img

Cover image

img_to_dark

Darken cover image

other_css

Add extra css

toc

Table of content

toc_depth

Table of content depth

number_sections

Number section headings

...

Arguments passed to pagedown::html_paged

Value

An R Markdown output format.

Examples

## Not run: 
# Requires pandoc

# Create an R Markdown example file
rmd_content <- "---
 title: 'Example UNHCR HTML'
 subtitle: 'Paged Report'
 output: unhcrdown::paged_report
 ---

 ## Introduction

 This is an example of a UNHCR-branded HTML paged report using `unhcrdown::paged_report`.
 "

# Write the R Markdown content to a file
example_file <- tempfile(fileext = ".Rmd")
writeLines(rmd_content, example_file)

# Render the R Markdown file
rmarkdown::render(example_file,
  output_format = unhcrdown::paged_report(),
  output_dir = tempdir()
)

# View the rendered HTML file
browseURL(render_file)

## End(Not run)

Function for UNHCR paged simple template

Description

Function for UNHCR paged simple template

Usage

paged_simple(back_html = TRUE, other_css = NULL, number_sections = FALSE, ...)

Arguments

back_html

Back-cover HTML including contact information

other_css

Add extra css

number_sections

Number section headings

...

Arguments passed to pagedown::html_paged

Value

An R Markdown output format.

Examples

## Not run: 
# Requires pandoc

# Create an R Markdown example file
rmd_content <- "---
 title: 'Example UNHCR HTML'
 subtitle: 'Paged Report Simple'
 output: unhcrdown::paged_simple
 ---

 ## Introduction

 This is an example of a UNHCR-branded HTML paged report siple using `unhcrdown::paged_simple`.
 "

# Write the R Markdown content to a file
example_file <- tempfile(fileext = ".Rmd")
writeLines(rmd_content, example_file)

# Render the R Markdown file
rmarkdown::render(example_file,
  output_format = unhcrdown::paged_simple(),
  output_dir = tempdir()
)

# View the rendered HTML file
browseURL(render_file)

## End(Not run)

Convert to UNHCR branded Powerpoint presentation

Description

Format for converting from R Markdown to an UNHCR branded Powerpoint presentation

Usage

pptx_slides(...)

Arguments

...

extra parameters to pass to officedown::rpptx_document

Value

An R Markdown output format.

Examples

## Not run: 
# Requires pandoc

# Create an R Markdown example file
rmd_content <- "---
 title: 'Example UNHCR PowerPoint Presentation'
 output: unhcrdown::pptx_slides
 ---

 ## Introduction

 This is an example of a UNHCR-branded PowerPoint presentation
 created using `unhcrdown::pptx_slides`.
 "

# Write the R Markdown content to a file
example_file <- tempfile(fileext = ".Rmd")
writeLines(rmd_content, example_file)

# Render the R Markdown file
rmarkdown::render(example_file,
  output_format = unhcrdown::pptx_slides(),
  output_dir = tempdir()
)

## End(Not run)