https://github.com/cran/odfWeave
Tip revision: 6595b75265f1f8dc87e105a481c6108485318bdf authored by Max Kuhn on 24 August 2008, 00:00:00 UTC
version 0.7.9
version 0.7.9
Tip revision: 6595b75
odfItemize.R
"odfItemize" <-
function(data, ...)
{
if(!is.vector(data)) stop("data must be a vector")
styles <- getStyles()
has <- function(x) !is.null(x) && x != ""
if(!has(styles$bullet)) stop("no bullet style")
itemStart <- paste(
' <text:p',
tagattr("text:style-name", paste(styles$bullet, "Paragraph", sep="")),
">",
sep = " ")
listStart <- paste(
' <text:list',
tagattr("text:style-name", styles$bullet),
">",
sep = " ")
bulletItems <- paste(' <text:list-item>\n', itemStart, format(data, ...), "</text:p>\n", ' </text:list-item>\n')
out <- paste(
listStart,
"\n",
paste(bulletItems, collapse = " "),
' </text:list>\n',
collapse = "\n")
structure(out, class = "odfItemize")
}
print.odfItemize <- function(x, ...) cat(x)