Skip to contents

This RMarkdown output format is a drop-in replacement for hugodown::md_document(). Like the later, it is designed to generate markdown that is maximally compatible with Hugo. It intelligently generates a preview so that you see something useful when Hugo isn't running, but it doesn't get in the way of hugo's full-site preview when it is.

Usage

md_document(
  toc = FALSE,
  toc_depth = 3,
  fig_width = 7,
  fig_asp = 0.618,
  use_boxes = FALSE,
  fig_retina = 2,
  tidyverse_style = TRUE,
  standalone = FALSE,
  includes = NULL,
  pandoc_args = NULL
)

Arguments

toc

TRUE to include a table of contents in the output

toc_depth

Depth of headers to include in table of contents

fig_width

Figure width (in inches).

fig_asp

Figure aspect ratio, defaults to the golden ratio.

use_boxes

TRUE to allow the use of info, warn, and output boxes.

fig_retina

Scaling to perform for retina displays. Defaults to NULL which performs no scaling. A setting of 2 will work for all widely used retina displays, but will also result in the output of <img> tags rather than markdown images due to the need to set the width of the image explicitly.

tidyverse_style

Use tidyverse knitr conventions? This sets

standalone

Set to TRUE to include title, date and other metadata field in addition to Rmd content as a body.

includes

Named list of additional content to include within the document (typically created using the includes function).

pandoc_args

Additional command line options to pass to pandoc

Details

On top of the functionality of hugodown::md_document() four new arguments are available. use_boxes allows the use of expendable html boxes. standalone, includes and pandoc_args are adapted from rmarkdown::md_document() and allow additional content and command line options.

Syntax highlighting

md_document() uses a hybrid system for syntax highlighting. For R code it uses downlit. For other languages, it relies on Chroma, the syntax highlighter built into hugo.

Reference

For examples of how to include expandable boxes when the use_boxes argument is set to TRUE refer to the vignette("customize-boxes", package = "hugodownplus")