When I render a a qmd file using the arrow render button in the rstudio IDE it will create a self-contained html file , but when I tell it to render via another function, all of the images are stored in a subdirectory i.e. not self-contained.
Here is my yaml heading:
---
title: "`r params$dist` Dashboard DA Summary"
format:
html:
theme: pulse
embed-resources: true
editor: visual
toc: true
toc-location: left
params:
dist: '27661590000000'
---
and here is the rendering code chuck that I use to create documents that so far is not working to make have resources embedded
for(i in da.dists){
dist <- list(dist = i )
dist.name <- mcoe_name(dist)
# render("DashboardSummary.qmd",
# # output_format = "all",
# # output_dir = "output",
# output_file = here("output" ,paste0("DashboardSummary", dist.name, ".html" ) ),
# params = dist,
# envir = new.env(parent = globalenv())
# )
quarto_render(#"DashboardSummary.qmd",
# output_format = "all",
# output_dir = "output",
# execute_dir = "output",
input = "DashboardSummary.qmd",
output_file = paste0("DashboardSummary", dist.name, ".html" ) ,
execute_params = dist,
# envir = new.env(parent = globalenv())
)
# file.rename(from = paste0("DashboardSummary", dist.name, ".html" ),
# to = here("output", paste0("DashboardSummary", dist.name, ".html" )) )
}```
Any suggestions on why the rendering behavior would be different and/or how to make it actually self-contained?
1 Like
cderv
January 9, 2023, 9:17am
2
Just to be sure, can you check the Quarto version used by both cases ?
In RStudio terminal, run quarto check install
quarto::quarto_version() and check quarto::quarto_path()
Options from your document YAML should be respected, but as embed-resources is quite new, maybe there is a version mismatched.
Thanks
I can confirm the bug posted by @dobrowski .
My quarto check install yields
[✓] Checking Quarto installation......OK
Version: 1.0.38
Path: /opt/quarto/bin
[✓] Checking basic markdown render....OK
And
> quarto::quarto_version()
[1] ‘1.0.38’
> quarto::quarto_path()
[1] "/usr/local/bin/quarto"
Is the different path the source of the problem?
cderv
January 18, 2023, 10:07am
4
This is quite an old installation now, as the latest in Quarto 1.2 and next is 1.3 current pre-release and soon to be out.
Quarto bundles Pandoc in a version, and it bundles Pandoc 2.18
# This file contains the global configuration for the quarto configuration
#
# The configuration is used both as a local runtime version of Quarto for developers
# but it also used when packaging (e.g. run configure.sh, then prepare-dist.sh, then package.sh)
# Binary dependencies
export DENO=v1.22.0
export DENO_DOM=v0.1.17-alpha
export PANDOC=2.18
export DARTSASS=1.32.8
export ESBUILD=0.14.39
# Bootstrap dependencies from bslib
# (use commit hash from bslib repo)
export BOOTSTRAP=888fbe064491692deb56fd90dc23455052e31073
export BOOTSTRAP_FONT=1.8.1
export BOOTSWATCH=5.1.3
# javascript HTML dependencies
embed-resource is from Pandoc 2.19
https://pandoc.org/releases.html#pandoc-2.19-2022-08-03
and not so also not supported in Quarto before v1.1.x
1 Like
I updated quarto, now everything works like a charm Thanks @cderv !
1 Like
system
Closed
February 17, 2023, 5:00pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.