Learn R Programming

ubiquity (version 1.0.3)

md_to_officer: Parse Markdown for OfficeR

Description

Parses text in Markdown format and returns fpar command strings to be used with OfficeR

Usage

md_to_officer(str)

Arguments

str

string containing Markdown can contain the following elements:

  • paragraph Two or more new lines creates a paragraph

  • "bold" Can be either "*text in bold*" or "_text in bold_"

  • "italic" Can be either "**text in bold**" or "__text in bold__"

  • "subscript" "Normal~subscript~"

  • "superscript" "Normal^superscript^"

Value

list with parsed paragraph elements ubiquity system object with the content added to the body, each paragraph can be found in a numbered list element (e.g. pgraph_1, pgraph_2, etc) each with the following elements:

  • locs Dataframe showing the locations of markdown elements in the current paragraph

  • pele These are the individual parsed paragraph elements

  • fpar_cmd String containing the fpar_cmd that can be run using eval to return the output of fpar. For example:

      myfpar = eval(parse(text=pgparse$pgraph_1$fpar_cmd))