Skip to content

Commit

Permalink
don't rewrite build_rmarkdown_format in pkgdown b/c no longer using p…
Browse files Browse the repository at this point in the history
…aged data frame printing
  • Loading branch information
crew102 committed Nov 2, 2018
1 parent 22bb935 commit 73fe7e4
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions inst/site/build-site.R
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
swap_render_fun <- function() {

# Alter pkgdown:::build_rmarkdown_format
build_rmarkdown_format2 <- function(pkg = ".",
depth = 1L,
data = list(),
toc = TRUE) {
path <- tempfile(fileext = ".html")
suppressMessages(
pkgdown::render_page(pkg, "vignette", data, path, depth = depth)
)
list(
path = path,
format = rmarkdown::html_document(
toc = toc,
toc_depth = 2,
self_contained = FALSE,
theme = NULL,
template = path,
df_print = "paged", # line added by crew102
rownames.print = FALSE
)
)
}
# old_fun <- get("build_rmarkdown_format", envir = asNamespace("pkgdown"))
# attributes(build_rmarkdown_format2) <- attributes(old_fun)
assignInNamespace(
"build_rmarkdown_format", build_rmarkdown_format2, ns = "pkgdown"
)
}

build_site <- function() {
# Render extra vignettes and move vignettes for pkgdown to pick up
extra_vigs <- list.files(
Expand All @@ -38,9 +7,5 @@ build_site <- function() {
on.exit(try(unlink(x = to, force = TRUE)))
file.copy(extra_vigs, to = to)

# Change render function in pkgdown so it uses paged df printing
swap_render_fun()

# Build site
pkgdown::build_site()
}

0 comments on commit 73fe7e4

Please sign in to comment.