Take a character vector and wrap each element in backticks to create a glue vector of inline code spans. This inline is rendered as a <code> HTML tag.

md_code(x)

Arguments

x

The text to be formatted as fixed-width inline code.

Value

A glue vector of length equal to x.

Details

A backtick string is a string of one or more backtick characters that is neither preceded nor followed by a backtick.

A code span begins with a backtick string and ends with a backtick string of equal length. The contents of the code span are the characters between the two backtick strings, normalized in the following ways: * First, line endings are converted to spaces. * If the resulting string both begins and ends with a space character, but does not consist entirely of space characters, a single space character is removed from the front and back. This allows you to include code that begins or ends with backtick characters, which must be separated by whitespace from the opening or closing backtick strings.

See also

Examples

md_code("ex_var")
#> `ex_var`
md_code(state.name[1:3])
#> `Alabama`
#> `Alaska`
#> `Arizona`