format_line: Format line with space margins.

Description Usage Arguments Value

View source: R/format_line.R

Description

Takes a string and formats it according the disired output type and considering line width and margin concerns. Where necessary, text will be broken up onto multiple lines, with line break escape characters respected.

Usage

1
2
3
4
5
6
7
format_line(
  x,
  linewidth = 80,
  right_margin = 5,
  left_margin = 1,
  type = c("basic", "roxygen2")
)

Arguments

x

String.

linewidth

Maximum number of characters per line.

right_margin

Number of spaces between the end of text and the maximum linewidth.

left_margin

Number of spaces before the beginning of text.

type

Two options:

  • basic: Simple format with # box at the beginning.

  • roxygen2: Format consistent with package builder roxygen2.

Value

A formated string specifying one or more lines.


danwkenn/ConsulR documentation built on Dec. 19, 2021, 8:11 p.m.