', title))
if (logo)
result <- c(result,
paste0(''))
result <- c(result, '
', '')
if (!is.null(up) || !is.null(top)) {
result <- c(result, '
')
if (!is.null(up))
result <- c(result,
paste0(''))
if (!is.null(top))
result <- c(result,
paste0(''))
result <- c(result, '
')
}
result
}
toHTML.packageIQR <-
function(x, ...)
{
db <- x$results
# Re-encode as utf-8
x$title <- iconv(x$title, to="UTF-8")
x$footer <- iconv(x$footer, to="UTF-8")
db <- iconv(db, to="UTF-8")
## Split according to Package.
out <- if(nrow(db) == 0L)
NULL
else
lapply(split(1:nrow(db), db[, "Package"]),
function(ind) db[ind, c("Item", "Title"), drop = FALSE])
result <- HTMLheader(...)
for(pkg in names(out)) {
result <- c(result,
paste0('
', htmlify(x$title), ' in package ‘',
htmlify(pkg), '’
'),
'
',
paste0('
\n',
'
\n',
htmlify(out[[pkg]][, "Item"]),
'\n
\n
\n',
htmlify(out[[pkg]][, "Title"]),
'\n
\n
\n'),
'
')
}
if(!is.null(x$footer))
result <- c(result, '
',
htmlify(x$footer),
'
')
result <- c(result, '')
result
}
toHTML.news_db <-
function(x, ...)
{
## local version
htmlify2 <- function(x) {
x <- psub("<([[:alnum:]._]+)>", "@VAR@\\1@EVAR@", x)
x <- fsub("&", "&", x)
x <- fsub("---", "—", x)
## usually a flag like --timing
## x <- fsub("--", "–", x)
x <- fsub("``", "“", x)
x <- fsub("''", "”", x)
x <- psub("`([^']+)'", "‘\\1’", x)
x <- fsub("`", "'", x)
x <- fsub("<", "<", x)
x <- fsub(">", ">", x)
x <- fsub("@VAR@", "", x)
x <- fsub("@EVAR@", "", x)
x
}
## For now, only do something if the NEWS file could be read without
## problems, see utils:::print.news_db():
if(is.null(bad <- attr(x, "bad"))
|| (length(bad) != NROW(x))
|| any(bad))
return(character())
print_items <- function(x)
c("