quarto-dev / quarto-cli

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

Quarto render command renaming and revert renaming folders at every render #9774

Open Stramon1um opened 5 months ago

Stramon1um commented 5 months ago

Hi,

It has been happening only recently, and I don't know what the reason behind it could be. Briefly: every time I execute the command quarto render, apart from rendering the .qmd files to .html, as expected, it also renames the folder docs/site_libs to docs/site_libs 2, breaking the layout of my website. Then, if I re-run quarto render, it reverts the names to docs/site_libs, and everything is fine. The screenshot shows the last execution of quarto render.

Did this happen to someone else before? Or do you know by chance what it is all about?

Thanks!

I'm running the last version of RStudio on macOS Sonoma. Quarto version 1.4.554.

2024-05-27_11 28 10
cderv commented 5 months ago

Is this happening with every project ? Can you share a repository or a project for which this happens ?

Also, please can you follow the issue template and give us some more information on your context ? https://github.com/quarto-dev/quarto-cli/blob/main/.github/ISSUE_TEMPLATE/bug_report.yml

We need at least quarto check information, and OS.

Being able to reproduce is really important for us. Thank you !

Stramon1um commented 5 months ago

Thanks for replying!

After posting, I tried to investigate the origin of this "issue" precisely when it started happening. As far as I discovered, the only extra thing I did in this project was to install a Quarto extension (https://dialoa.github.io/first-line-indent/). However, it didn't work properly (probably due to the version), and I forgot about it without removing it. Actually, only after that specific event, I noticed that at every render, it was renaming folders as I described. In fact, I was used to committing twice to revert this behaviour.
Just now, I followed the docs and cleanly removed the extension. I did the usual quarto render, but nothing as mentioned above happened. Unfortunately, I need to wait until I create and publish another post on my website to be 100% sure that the issue has disappeared.

By the way, here you have my quarto check

Quarto 1.4.554 [✓] Checking versions of quarto binary dependencies... Pandoc version 3.1.11: OK Dart Sass version 1.69.5: OK Deno version 1.37.2: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.4.554 Path: /Applications/quarto/bin

[✓] Checking tools....................OK TinyTeX: (not installed) Chromium: (not installed)

[✓] Checking LaTeX....................OK Tex: (not detected)

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

[✓] Checking Python 3 installation....OK Version: 3.9.6 Path: /Library/Developer/CommandLineTools/usr/bin/python3 Jupyter: (None) Jupyter is not available in this Python installation. Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK Version: 4.3.2 Path: /Library/Frameworks/R.framework/Resources LibPaths:

[✓] Checking Knitr engine render......OK

Running Quarto v1.4.554 in RStudio v2024.04.1 Build 748, macOS Sonoma 14.5.

As soon as I publish a new blog post and render the project, I will update you 😉

Thanks again!

Stramon1um commented 5 months ago

Ok, I'm back with a small update.

I added a new blog post as planned, but it appeared again. I had to render twice to revert to normality, so it wasn't the extension after all.

I did some experiments and a lot of quarto render runs 😅 but I might have noticed something. Without adding or modifying any files or folders, I started rendering continuously until it appeared! It seems that when you render a .qmd file (which is actually a quarto preview), open the viewer and change page/s within the viewer like browsing a website (both RStudio and Safari), and then run quarto render again, it renames docs/site_libs to docs/site_libs 2. Whereas, when you render the .qmd page without navigating to any other page, it doesn't seem to appear.

I also remembered that the issue started when I updated quarto to 1.4.553. I created the whole website on quarto 1.3.450. Unfortunately, this is the only way I managed to reproduce this weird behaviour. I don't know if some files are corrupted or if it more related to RStudio+quarto or else.

Thanks!

mcanouil commented 5 months ago

Unfortunately, this does not help more. We really need something to work on such as a small plain text document, a Git repository.

Without, we are unable to provide you with any assistance.

Stramon1um commented 5 months ago

I see. Currently, I've been using Quarto only in one public repository, which is my personal website repository (see my profile). As written above, I'm running Quarto v1.4.554 in RStudio v2024.04.1 Build 748, macOS Sonoma 14.5.

I would like to give you more info or examples on how to replicate this issue, but I post not so often on my website, and most importantly, my skills are very basic in all of this. :)

cderv commented 5 months ago

We understand.

It seems it does not happen always, and only in some specific situation. I suggest we keep this open and you can come back when you identified more situation where this happens. We can also see if someone else is noticing the same - for now, I never noticed this on Windows myself.

You can also share your personal repo and we can try reproduce from there.

Thanks for the report.

github-actions[bot] commented 4 months ago

Thank you for using Quarto and reporting an issue!

Unfortunately, this issue is now considered stale because it has been opened since 14 days without providing a "working" reproducible example to help us investigate. If you are still facing the issue, please review the "Bug Reports" guide on how to provide a fully reproducible example as a self-contained Quarto document or a link to a Git repository. Without a reproducible example, it is unlikely that the issue will be addressed.

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.

Stramon1um commented 4 months ago

Ok, I'm back again!

I might have found what was causing me this non-continuous issue. I'm still not 100% sure, but it seems to have disappeared once and for all. I believe it was the iCloud sync.

Using GitHub Desktop, it set the directory of all my repositories in my Documents by default, which iCloud also syncs. So far, so good. As I wrote earlier, I remembered that this "renaming issue" started when I started embedding PDF files in my webpage. Today, I had the same issue rendering my last post. I tried to purge the doc and .quarto folders to re-render the whole project, and I found copies of the index.html, like index 2.html, randomly left in my post folder (which contains only the .qmd files. After another quarto render, I got new problems. At the same time, I noticed that iCloud was struggling to sync files*...Only at this point, I removed the whole repository from iCloud, cloned the last version outside of iCloud and ran quarto render...and then again, previewed some pages, moved within the previewed website and rendered again a couple of times more....nothing, no more renaming, no more issue of this kind!

Probably, when involving larger files, like PDF, the continuous sync of iCloud + the render/regeneration of folders/files does not work very well; I guess Quarto renders too fast to allow iCloud to sync/desync large files simultaneously, and maybe that's why I was having copies of folders and files from time to time....or at least this is my theory 😁

By the way, with the next post, I will be much more sure, although so far, it seems to be working flawlessly, no matter how many times I render.

mcanouil commented 4 months ago

To summarise, you are rendering in a cloud synced folder? If so, it's unfortunately not a surprise that this does not work well.

Stramon1um commented 4 months ago

To summarise, you are rendering in a cloud synced folder? If so, it's unfortunately not a surprise that this does not work well.

Yes, I was. But as I mentioned, everything was fine until I started involving PDFs. Now I know...

EDIT: I rendered a new post and did things I usually do, like browsing the whole website preview in the RStudio Viewer and Safari. Nothing weird happened. So, I think the "issue" was rendering post+PDF in a cloud-synced folder.