Turn a character vector of lines into a single code block with each line
indented four spaces. This markdown leaf block can be rendered as nested HTML
<code>
and <pre>
tags. This is the code block format required by legacy
Reddit-flavored Markdown.
md_indent(x, n = 4)
A character vector of lines to be wrapped concatenated into a
single block, possibly created by readLines()
or deparse()
.
A numeric vector
A glue
object of length 1, with the elements of x
preceded with
4 spaces and separated by a newline.
An indented code block is composed of one or more indented chunks separated by blank lines. An indented chunk is a sequence of non-blank lines, each indented four or more spaces. The contents of the code block are the literal contents of the lines, including trailing line endings, minus four spaces of indentation. An indented code block has no info string.
Other leaf block functions:
md_blank()
,
md_chunk()
,
md_fence()
,
md_heading()
,
md_label()
,
md_paragraph()
,
md_reference()
,
md_rule()
,
md_setext()
,
md_table()
md_indent(deparse(md_bold))
#> function (x)
#> {
#> glue::glue("**{x}**")
#> }