format_shell_command: Format a shell command as a Markdown codeblock.

View source: R/utils_text.R

format_shell_commandR Documentation

Format a shell command as a Markdown codeblock.

Description

The shell command will be formatted such that each item of lines is put onto a separate line suffixed by ⁠ \⁠.

Usage

format_shell_command(lines, language = "bash", wrap = TRUE)

wrap_code(lines, collapse = TRUE, language = "bash")

format_shell_commands(commands, language = "bash", wrap = TRUE)

Arguments

lines

A character vector: code lines.

language

A character scalar: codeblock language.

wrap

A logical scalar: if TRUE, run wrap_code() onto the formatted command.

collapse

A logical scalar: if TRUE, collapse the lines by newline (⁠\n⁠).

commands

A list of character vectors with command lines passed into format_shell_command().

Value

A character vector.


bioinfocz/scdrake documentation built on Sept. 19, 2024, 4:43 p.m.