Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Override argument passed by rmarkdown::render_site
Browse files Browse the repository at this point in the history
`rmarkdown::render_site()` passes `self_contained = TRUE` into the ellipsis
(dots) `...` argument of `govdown_document()`, which passes it on to where it
causes rendering of large images to hang.

Reported in #39, introduced when fixing #32.
  • Loading branch information
nacnudus committed Oct 2, 2019
1 parent 82d07a3 commit 04473a4
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions R/govdown-format.R
Expand Up @@ -192,17 +192,10 @@ govdown_document <- function(keep_md = FALSE,
# Use highlights.js from the rmarkdown package
extra_dependencies <- list(rmarkdown::html_dependency_highlightjs("default"))

base_format <- rmarkdown::output_format(
knitr = NULL,
pandoc = rmarkdown::pandoc_options(
to = "html",
from = rmarkdown::from_rmarkdown(implicit_figures = FALSE,
extensions = "+smart")
),
keep_md = keep_md,
pre_processor = pre_processor,
base_format =
rmarkdown::html_document_base(
dots <- list(...)
html_document_base_args <-
c(
list(
mathjax = NULL,
pandoc_args = c(pandoc_args,
"--css", rmarkdown::pandoc_path_arg(css),
Expand All @@ -214,9 +207,24 @@ govdown_document <- function(keep_md = FALSE,
"--highlight-style=pygments",
"--mathjax"
),
extra_dependencies = extra_dependencies,
...
)
extra_dependencies = extra_dependencies
),
dots)

# override arguments provided by rmarkdown::render_site()
html_document_base_args$self_contained <- NULL

base_format <- rmarkdown::output_format(
knitr = NULL,
pandoc = rmarkdown::pandoc_options(
to = "html",
from = rmarkdown::from_rmarkdown(implicit_figures = FALSE,
extensions = "+smart")
),
keep_md = keep_md,
pre_processor = pre_processor,
base_format = do.call(rmarkdown::html_document_base,
html_document_base_args)
)

base_format
Expand Down

0 comments on commit 04473a4

Please sign in to comment.