Skip to contents

This is just a convenience function to convert a vector of strings into markdown or HTML headings at a given 'depth'.

Usage

heading_vector(
  x,
  headingLevel = rock::opts$get("defaultHeadingLevel"),
  output = "markdown",
  cat = FALSE
)

Arguments

x

The vector.

headingLevel

The level of the heading; the default can be set with e.g. rock::opts$set(defaultHeadingLevel=1).

output

Whether to output to HTML ("html") or markdown (anything else).

cat

Whether to cat (print) the heading or just invisibly return it.

Value

The heading, invisibly.

Examples

rock::heading_vector(c("Hello ", "World"), headingLevel=5);
### This produces: "\n\n##### Hello\n\n" and
### "\n\n##### World\n\n"