Open hamelsmu opened 1 year ago
I can repro that here as well. Wild.
(I think @dragonstyle did our line numbering support)
I can repro that here as well. Wild.
😄 Thank you. I thought I was losing my mind! Hahaha the error didn't make any sense in relation to what I was changing, that is why it took so long for me to isolate this!
FWIW nothing to do with code-line-numbers
as I can repro just by adding revealjs: default
to the format with same error
I think what happens is a conflict betwen html
and revealjs
that both aim to output some HTML files. Those two formats produce HTML so they overwrite each other, but in the case of a project rendering with output-dir
set, the moving of file raises an error, because there is only one file to move as both formats have written to the same file.
Here the detailed explanation of why this happens (not sure you are expecting this behavior)
Regarding this usage in _quarto.yml
, it will be merged with document level format, and I believe this part of the doc is important
Note that when metadata is combined, objects and arrays are merged rather than simply overwriting each other. (...) The one exception to metadata merging is format. If the document-level YAML defines a format, it must define the complete list of formats to be rendered.
This means to me that if no format is defined at a document level, then both from _quarto.yml
level will be used. The file from the error (https://github.com/hamelsmu/embed-debug-quarto/blob/main/1_setup/index.qmd) does not get a format
key, so I think it will be rendered to format: html
and format: revealjs
, and the fact that both produce html makes something trip.
Setting
---
title: "Setup"
order: 1
format: html
---
in the file remove the error.
Also to verify what I am saying you could try not setting a format
in the Document level and use pdf in _quarto.yml
format:
html:
code-copy: true
theme: cosmo
css: styles.css
pdf: default
After quarto render
, a pdf file for 1_setup/index.qmd
will be produced.
Now add back the format: html
in this qmd file -> No PDF file is rendered at all. The format
for pdf
defined in _quarto.yml
is completely ignored by quarto render
because
format
define as document level. This happens at https://github.com/quarto-dev/quarto-cli/blob/ea8942094ad670ccbb9d6f8fcafc4bcf097aa7cc/src/command/render/render-contexts.ts#L448-L454
This way of merging project formats with other format metadata is the default one - only book project only consider project format only.
index.html
I believe this is the same as https://github.com/quarto-dev/quarto-cli/issues/4470 for revealjs and HTML, and close to https://github.com/quarto-dev/quarto-cli/issues/1929 about multiple markdown output format
Quarto currently have no way to track all this correctly and so a format producing .html
will overwrite a previous one producing also a .html
(Next big improvement probably - https://github.com/quarto-dev/quarto-cli/issues/6518)
Error is from
https://github.com/quarto-dev/quarto-cli/blob/ea8942094ad670ccbb9d6f8fcafc4bcf097aa7cc/src/command/render/project.ts#L328-L333
and this happens for each output file. format: html
and format: revealjs
have the same output file, so it errors because there is only one to move
Anyhow, sorry for long post. It is not the first time this happens so now we have a written explanation until https://github.com/quarto-dev/quarto-cli/issues/6518 helps us solve all this.
Bug description
In my
_quarto.yml
file, if I add these options:I get the following error
Steps to reproduce
I have made a minimal repro here
I am using Quarto
1.3.450
To repro, do the following:
Expected behavior
No response
Actual behavior
No response
Your environment
1.3.450
Quarto check output
[✓] Checking versions of quarto binary dependencies... Pandoc version 3.1.1: OK Dart Sass version 1.55.0: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.3.450 Path: /Applications/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK Version: 3.10.12 (Conda) Path: /Users/hamel/mambaforge/bin/python Jupyter: 5.3.0 Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK Version: 4.0.4 Path: /Library/Frameworks/R.framework/Resources LibPaths:
[✓] Checking Knitr engine render......OK
cc: @jjallaire @cscheid