Skip to contents

Functions for creating ast nodes,

  • rmd_ast() - Create an ast container of nodes

  • rmd_yaml() - Create a yaml node

  • rmd_heading() - Create a heading node

  • rmd_code_blokc() - Create a markdown code block node

  • rmd_chunk() - Create a chunk node

  • rmd_raw_chunk() - Create a raw chunk node

  • rmd_fenced_div_open() - Create a fenced div open node

  • rmd_fenced_div_close() - Create a fenced div close node

  • rmd_markdown() - Create a markdown container node of rmd_markdown_lines

  • rmd_markdown_line() - Create a markdown line node

  • rmd_inline_code() - Create an inline code node

  • rmd_shortcode() - Create a shortcode node

Usage

rmd_ast(...)

rmd_yaml(...)

rmd_heading(name, level)

rmd_code_block(attr = "", code = character(), indent = "", n_ticks = 3L)

rmd_chunk(
  name = NULL,
  engine = "r",
  options = list(),
  yaml_options = list(),
  code = character(),
  indent = "",
  n_ticks = 3L
)

rmd_raw_chunk(format, code = character(), indent = "", n_ticks = 3L)

rmd_fenced_div_open(attr = character())

rmd_fenced_div_close()

rmd_markdown(...)

rmd_markdown_line(...)

rmd_inline_code(engine = "", code = "")

rmd_shortcode(func, args = character())

Arguments

...

Elements within the node.

name

Character. Heading or chunk name.

level

Integer. Heading level (1-6).

attr

Character. Attributes for code block or fenced div.

code

Character. Code lines for code block or chunk.

indent

Character. Indentation for code block or chunk.

n_ticks

Integer. Number of backticks for code block or chunk.

engine

Character. Language engine for chunk or inline code

options

List. Chunk options.

yaml_options

List. Chunk yaml options.

format

Character. Format for raw chunk.

func

Character. Shortcode function name.

args

Character. Shortcode arguments.

Value

An object with class matching the function name, e.g. rmd_ast() returns an rmd_ast object.