Skip to contents

These functions are assigned to blocks inside plan_sec(b* = fun(...)). See morphing. The functions e() and div() edit existing blocks:

  • e() is used on single-lines of text, that have been split into clauses.

  • div() is used on multi-line blocks of text, that have been split by lines.

Usage

e(
  keep = NULL,
  end = NULL,
  breaks = NULL,
  adds = NULL,
  subs = NULL,
  modify = function(x) x,
  sep = add_pause(),
  sep_n = 1
)

div(
  keep = NULL,
  end = NULL,
  breaks = NULL,
  adds = NULL,
  subs = NULL,
  modify = function(x) x,
  sep = add_pause(),
  sep_n = NULL,
  sep_fragment = FALSE
)

Arguments

keep

Indexes of the clauses (for e()) or lines (for div()) to keep. Defaults to all (NULL).

end

Character specifying what to add at the end of the block, passed to get_end(). The default value is whatever was passed to the morph_sec()'s end argument. Possible values are:

  • 'pbr' for add_pause() (the default);

  • 'p' for add_pause(FALSE);

  • 'br' for add_br();

  • 'lb' for '' (an empty line);

  • 'none' for NULL (nothing).

breaks

Indexes to insert sep after. If sep_fragment = TRUE, it should be a list of indexes to surround with '.fragment' markdown blocks.

adds, subs

Character vector specifying additions or substitutions (respectively) on the final punctuation of each clause in keep. Defaults to none (NULL).

modify

Function to to the block, after the base manipulations.

sep

What to add after the indexes specified by breaks.

sep_n

Add sep after the break + sep_n[1] elements. sep_n[2] is for before the break (when sep_fragment = TRUE).

sep_fragment

Instead of sep, should the elements specified by breaks be encapsulated in a ".fragment" markdown block? (for revealjs).