comment_out: Comment out codes based on their languages.

Description Usage Arguments See Also Examples

View source: R/hook_title_comment.R

Description

Comment out codes based on their languages.

Usage

1
comment_out(x, engine, extra_syntax = character(0L))

Arguments

x

A character vector

engine

A string that defines the engine of the x. See names(comment_syntax) for the predefined engines.

extra_syntax

A named character vector which defines extra syntax to comment out. Each values should contain %s which is the placeholder to insert x. If definitions collides among comment_syntax and extra_syntax, then the latter has priority.

See Also

comment_syntax()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Default behaviors
comment_out("R language", "R")
comment_out("Python language", "python")

# A customized behavior
comment_out(
  "Python language",
  "python",
  extra_syntax = c("python" = '"""%s"""')
)

atusy/chunkhooks documentation built on Nov. 30, 2021, 10:32 a.m.