Skip to content

Image resources not enumerated in inspect output #3053

@aronatkins

Description

@aronatkins

Bug description

The quarto inspect command does not include images in its resource list, which forces manual resource addition when publishing.

Given the Quarto document:

---
format: revealjs
---

# Presentation {background-image="logo.svg" background-opacity="0.2"}
![bcorp](bcorps-logo.svg)

Any two images can be used for this example, just make sure you use distinct images for the background and the inline image.

The quarto inspect command returns an empty set of resources:

quarto inspect | jq '.files.resources'
# => []

This causes problems when publishing the content, as the images are not included in the deployed bundle by default.

From RStudio, part of the problem is avoided because rmarkdown::find_external_resources reports the inline image.

rmarkdown::find_external_resources("index.qmd")
# =>              path explicit  web
# => 1 bcorps-logo.svg    FALSE TRUE

The quarto::quarto_publish_doc function merges the Quarto resources from quarto inspect (though not the files.resources) with the results from rmarkdown::find_external_resources.

https://github.com/quarto-dev/quarto-r/blob/146bb4ed542ef5743cd182464d17919bcfb5b0eb/R/publish.R#L49

https://github.com/quarto-dev/quarto-r/blob/146bb4ed542ef5743cd182464d17919bcfb5b0eb/R/publish.R#L104-L109

I'm not sure if the RStudio publishing flow is different from the quarto_publish_doc implementation.

Quarto source resources should be identified when publishing through some combination of these pieces. Currently, the logo.svg used as a slide background is not identified.

Quarto: 1.2.242
RStudio: 2022.12.0-daily+286
rmarkdown: 2.14
macOS: Monterey (12.6)

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions