Package 'hugodownplus'

Title: Extend 'hugodown's markdown document with toc and html boxes.
Description: hugodownplus extends 'hugodown's md_document with toc and HTML boxes. It allows the use of the arguments 'includes' and 'pandoc_args' which are available in rmarkdown::md_document.
Authors: Tim Tiefenbach [aut, cre] , Shafayet Khan Shafee [aut]
Maintainer: Tim Tiefenbach <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-11-20 03:19:20 UTC
Source: https://github.com/timteafan/hugodownplus

Help Index


An Rmd child template that produces a collapsed session info box

Description

When called in an Rmd document this function generates child document containing an expandable session info box.

Usage

child_session_info(pkgs = c("loaded", "attached", "installed")[1])

Arguments

pkgs

Which packages to show. It may be:

  • NULL or "loaded": show all loaded packages,

  • "attached": show all attached packages,

  • "installed": show all installed packages,

  • a character vector of package names. Their (hard) dependencies are also shown by default, see the dependencies argument.

Examples

Call this function on a separate line using inline code ⁠{r, eval = FALSE, echo = TRUE}r child_session_info()⁠.

css

In CSS Use the .session class to target the whole expandable box. Use summary.session-header to target the box header. Use .session-details to target the content of the box.


An Rmd output format that produces Hugo-flavoured markdown

Description

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")