quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.88k stars 318 forks source link

RStudio "Render Website" doesn't render all outputs (sometimes) #4525

Closed cwickham closed 4 months ago

cwickham commented 1 year ago

Bug description

Using template website created with quarto create, and editing YAML in about.qmd to specify a couple of formats:

---
title: "About"
format:
  revealjs: default
  pdf: default
---

I would expect if I hit RStudio's "Render Website" I would have about.pdf and about.html (Revealjs slides) in _site/, but I'm missing about.pdf:

_site
├── about.html
├── index.html
├── search.json
├── site_libs
└── styles.css

I actually get the same thing from quarto preview (no about.pdf), although if I then navigate to about.html, about.pdf is generated. (Browsing to about.html from the Preview of "Render Website", does not trigger a render of about.pdf).

quarto render generates all files as expected.

I thought the problem didn't occur with pdf and html:

---
title: "About"
format:
  html: default
  pdf: default
---

But, I seem to be having the same problem with "Render Website" for this too. While about.pdf isn't generated initially, it does get triggered if I hit the PDF version in the "Other Formats" links.

(@mine-cetinkaya-rundel)

This feels a bit like #4469 - but I'm not convinced they are exactly the same problem.

Mac OS, Version 2023.03.0-daily+302 (2023.03.0-daily+302), dev Quarto

Checklist

cscheid commented 1 year ago

(This is the same format pinning issue we've discussed before, I'm pretty sure, right @jjallaire?)

prosoitos commented 12 months ago

Not sure whether this is pertinent to the same issue or whether I should open a different one, but for many months (maybe after my website reached a certain size??), quarto render has systematically failed to render the site_libs.

For this to get created, after a full quarto render, I have to run a quarto preview.

This is for the website at https://github.com/WestDRI/arc-training.

cscheid commented 12 months ago

@prosoitos We use quarto render on https://quarto.org, so I don't believe size is an issue. Unfortunately, we need a small reproducible case to be able to help.

prosoitos commented 12 months ago

If it is not a known problem, it probably is something idiosyncratic to my system and setup again.

It is not a huge issue. I just have to do a preview after every render.

I believe my site might be quite a bit larger than the Quarto site, with several heavy reveal.js presentations in it. Renders are taking quite a long time now, even with freezing and caching, so I wouldn't rule out size to be the problem. But I could be totally wrong. I'll do some testing when I have time and try to produce a small reproducible example (although that might be impossible if it has to do with size).

mcanouil commented 12 months ago

I am not sure the size is an issue, see:

jcoliver commented 5 months ago

Same behavior (PDF formats not created when "Render Website" button is pressed, but PDF file is generated when clicking the "PDF" hyperlink in the Other formats section on the rendered HTML) on Ubuntu 22.04, R 4.4.0, RStudio 2023.06.0, quarto 1.4.

Edit: However, when individual qmd files are rendered via the "Render" button or the keyboard shortcut (Shift+Ctrl+K), the PDF file is created.

cscheid commented 4 months ago

This is the output of quarto render on a project created in that fashion. Note the presence of both about.pdf and about.html as a revealjs file:

$ ls -l
total 136
drwxr-xr-x  8 cscheid  staff   256B Jun 11 14:18 .
drwxr-xr-x  8 cscheid  staff   256B Jun 11 14:18 ..
-rw-r--r--  1 cscheid  staff    31K Jun 11 14:18 about.html
-rw-r--r--  1 cscheid  staff   4.8K Jun 11 14:18 about.pdf
-rw-r--r--  1 cscheid  staff    20K Jun 11 14:18 index.html
-rw-r--r--  1 cscheid  staff   230B Jun 11 14:18 search.json
drwxr-xr-x  8 cscheid  staff   256B Jun 11 14:18 site_libs
-rw-r--r--  1 cscheid  staff    17B Jun 11 14:18 styles.css
$ head -n 25 about.html
<!DOCTYPE html>
<html lang="en"><head>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-html/tabby.min.js"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/light-border.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-html.min.css" rel="stylesheet" data-mode="light">
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
  <meta name="generator" content="quarto-99.9.9">

  <title>Issue-4525 – About</title>
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
  <link rel="stylesheet" href="site_libs/revealjs/dist/reset.css">
  <link rel="stylesheet" href="site_libs/revealjs/dist/reveal.css">

It is true that quarto preview sometimes operates incrementally, but that's not a bug; that's a feature, and when the .pdf file is requested, the standalone preview server renders and displays it.

If this behavior isn't happening inside RStudio, then it's likely that this is an RStudio bug?

I'm going to go ahead and close this one, but please feel free to reopen if you believe my assessment is wrong.

prosoitos commented 4 months ago

For info, the problem I had and mentioned above about site_libs not being produced during a render got fixed by a reinstall of Quarto.

jcoliver commented 4 months ago

Will try to create a reprex, but I notice this behavior (of only rendering into HTML and not into PDF format) seems to only occur on the second (and subsequent) press of the "Render" button. That is, I can open a new RStudio session, edit a qmd file, and press the "Render" button and both HTML and PDF outputs are created (both formats are listed in the format section of my _quarto.yml file). However, in the same RStudio session, if I make additional changes and press the "Render" button (just clicking the button, not using the drop-down options to pick either HTML or PDF) only the HTML-formatted file is created. This might help with understanding the idiosyncratic behavior.

cscheid commented 4 months ago

@jcoliver Thanks for the added context. It's still the case that you're experiencing this only inside RStudio, right?

If so, then the place to report that is https://github.com/rstudio/rstudio

jcoliver commented 3 months ago

Done! https://github.com/rstudio/rstudio/issues/14920