parseGPmarkdown: parseGPmarkdown

View source: R/parseGPmarkdown.R

parseGPmarkdownR Documentation

parseGPmarkdown

Description

Functions to replace custom expressions with appropriate links or text. Custom tags include "{vid 1}", "{vid 2}" or "{item 1}", "{item 2}" more generally. Both have the same effect, but vid is clearer when reading and enforces video type, while item is more flexible. Symbols for media types: 'video'= ▶, 'pdf' or default= ➚. Special case for media titles with keyword "Cards"= ♧

Usage

parseGPmarkdown(
  x,
  WD = NULL,
  mlinks = NULL,
  use_cache = TRUE,
  force_lookup = FALSE
)

Arguments

x

a text string to parse

WD

working directory; default=NULL

mlinks

a tibble read in from the 'multimedia' tab of the 'teach-it.gsheet'. Default=NULL will trigger import of this data, using the front-matter in the provided WD.

  • This data is used to expand our custom markdown; e.g. "{vid1}" will be replaced with a markdown link to the video in the links spreadsheet multimedia tab that has order=1

use_cache

logical; do you want to use saved multimedia links if they are found at ../meta/multimedia.RDS? default =T will prefer the cached files. use_cache=FALSE will trigger a time-consuming gdrive lookup to teach-it.gsheet*!multimedia

force_lookup

logical; do you want to force looking up teach-it.gsheet*!multimedia? default=FALSE

Value

formatted replacement text

See Also

Other markdown: expand_md_links(), fixAnchorLinks()


galacticpolymath/GPpub documentation built on April 5, 2025, 6:04 p.m.