| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/pandoc.R |
| 3 |
\name{pandoc.list.return} |
| 4 |
\alias{pandoc.list.return} |
| 5 |
\alias{pandoc.list} |
| 6 |
\title{Create a list} |
| 7 |
\usage{ |
| 8 |
pandoc.list.return( |
| 9 |
elements, |
| 10 |
style = c("bullet", "ordered", "roman"), |
| 11 |
loose = FALSE, |
| 12 |
add.line.breaks = TRUE, |
| 13 |
add.end.of.list = TRUE, |
| 14 |
indent.level = 0, |
| 15 |
missing = panderOptions("missing"), |
| 16 |
... |
| 17 |
) |
| 18 |
} |
| 19 |
\arguments{ |
| 20 |
\item{elements}{character vector of strings} |
| 21 |
|
| 22 |
\item{style}{the required style of the list} |
| 23 |
|
| 24 |
\item{loose}{adding a newline between elements} |
| 25 |
|
| 26 |
\item{add.line.breaks}{adding a leading and trailing newline before/after the list} |
| 27 |
|
| 28 |
\item{add.end.of.list}{adding a separator comment after the list} |
| 29 |
|
| 30 |
\item{indent.level}{the level of indent} |
| 31 |
|
| 32 |
\item{missing}{string to replace missing values} |
| 33 |
|
| 34 |
\item{...}{extra arguments passed by from parent call, disregarded} |
| 35 |
} |
| 36 |
\value{ |
| 37 |
By default this function outputs (see: \code{cat}) the result. If you would want to catch the result instead, then call the function ending in \code{.return}. |
| 38 |
} |
| 39 |
\description{ |
| 40 |
Creates a Pandoc's markdown format list from provided character vector/list. |
| 41 |
} |
| 42 |
\examples{ |
| 43 |
## basic lists |
| 44 |
pandoc.list(letters[1:5]) |
| 45 |
pandoc.list(letters[1:5]) |
| 46 |
pandoc.list(letters[1:5], 'ordered') |
| 47 |
pandoc.list(letters[1:5], 'roman') |
| 48 |
pandoc.list(letters[1:5], loose = TRUE) |
| 49 |
|
| 50 |
## nested lists |
| 51 |
l <- list("First list element", |
| 52 |
rep.int('sub element', 5), |
| 53 |
"Second element", |
| 54 |
list('F', 'B', 'I', c('phone', 'pad', 'talics'))) |
| 55 |
pandoc.list(l) |
| 56 |
pandoc.list(l, loose = TRUE) |
| 57 |
pandoc.list(l, 'roman') |
| 58 |
|
| 59 |
## complex nested lists |
| 60 |
pandoc.list(list('one', as.list(2))) |
| 61 |
pandoc.list(list('one', list('two'))) |
| 62 |
pandoc.list(list('one', list(2:3))) |
| 63 |
} |
| 64 |
\references{ |
| 65 |
John MacFarlane (2012): _Pandoc User's Guide_. \url{https://johnmacfarlane.net/pandoc/README.html} |
| 66 |
} |