Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightbox fails with computational cells in self-contained HTML docs #6892

Closed
jack-davison opened this issue Sep 18, 2023 · 6 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jack-davison
Copy link

jack-davison commented Sep 18, 2023

Bug description

Using the v1.4 pre-release, the lightbox feature fails when the HTML is self-contained. It works perfectly when not self-contained, but when resources are embedded nothing pops up:

image

And you get this message in the render screen:

Watching files for changes
  /testqmd_files/figure-html/fig-mypic-1.png (404: Not Found)

Steps to reproduce

---
title: "lightbox test"
format: 
  html:
    embed-resources: true
editor: visual
lightbox: auto
---

## Lightboxes (click the pics!)

See @fig-mypic

```{r}
#| label: fig-mypic
#| fig-cap: "A delightful plot."
plot(iris)
```

Expected behavior

I would expect that, on clicking on the plot, a lightbox should show containing a big version of it.

Actual behavior

Instead, a circle spins infinitely with the background shaded out, as pictured above. The RStudio render pane complains about failing to find the PNG file.

Your environment

  • IDE RStudio 2023.03.0 Build 386
  • Windows 10

Quarto check output

$ quarto check
Quarto 1.4.371
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.8: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.4: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.371
      Path: C:\Users\jd38\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\jd38\AppData\Roaming\TinyTeX\bin\win32\
      Version: 2022

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....(None)

      Unable to locate an installed version of Python 3.
      Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK
      Version: 4.2.3
      Path: C:/Users/jd38/AppData/Local/Programs/R/R-4.2.3
      LibPaths:
        - C:/Users/jd38/AppData/Local/R/win-library/4.2
        - C:/Users/jd38/AppData/Local/Programs/R/R-4.2.3/library
      knitr: 1.44
      rmarkdown: 2.25

[>] Checking Knitr engine render......OK
@jack-davison jack-davison added the bug Something isn't working label Sep 18, 2023
@mcanouil
Copy link
Collaborator

Thanks for the report!

Could you edit your post to make your example usable?

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)
```

The end.
````

@jack-davison
Copy link
Author

@mcanouil - sure thing, just edited it now.

@dragonstyle
Copy link
Collaborator

Note to self, this is a result of the fact that the way Lightbox works is is by creating a a href that points to the image and wrapping that around the lightboxed image. We do this at render time, when the image still has a src pointing to a remote URL. Later, we ingest the embedded-resources, replacing the image src with a base64 copy of the image, but leaving the href pointing to the remote image)

@dragonstyle dragonstyle added this to the v1.4 milestone Sep 18, 2023
@cderv
Copy link
Collaborator

cderv commented Sep 19, 2023

Just for reference with initial issue on this front:

@mcanouil mcanouil added the extensions relates to Quarto extensions mechanism label Sep 19, 2023
@wilcar
Copy link

wilcar commented Nov 23, 2023

I have the same issue. Do you think it is possible to fix it in a next release ?

@mcanouil
Copy link
Collaborator

See the milestone attached/scheduled.
image

@mcanouil mcanouil removed the extensions relates to Quarto extensions mechanism label Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants