knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

solarizeddocx

R-CMD-check

knitr::include_graphics("man/figures/side-by-side-2.png", dpi = 300)

solarizeddocx provides an RMarkdown output format to create a docx file with solarized syntax highlighting. It works by provide custom style files to pandoc.

Currently only the light solarized theme is supported.

Installation

You can install the development version of solarizeddocx from GitHub with:

# install.packages("devtools")
devtools::install_github("tjmahr/solarizeddocx")

Usage

This format can be used via YAML metadata.

output: 
  solarizeddocx::document: default

Or explicitly with rmarkdown:

rmarkdown::render(
  "README.Rmd", 
  output_format = solarizeddocx::document()
)

Customization

The built-in demo function will render a vignette detailing all of the customizations used by the package.

solarizeddocx::demo_document()
rmarkdown::render(
  solarizeddocx::file_syntax_test(), 
  output_format = rmarkdown::word_document(), 
  output_file = "defaults.docx", 
  output_dir = "."
)

Assets

This format's styling assets can be accessed by the included file_ functions. For example, here is how one could sneak this format's solarized theme into an HTML document.

rmarkdown::render(
  "README.Rmd", 
  output_format = rmarkdown::html_document_base(
    pandoc_args = rmarkdown::pandoc_highlight_args(
      solarizeddocx::file_solarized_light_theme()
    ) 
  )
)


tjmahr/solarizeddocx documentation built on May 4, 2022, 3:35 p.m.