You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gfm output gets overwritten if other formats are also generated #6705
This is an unfortunate clash with our intermediate files. It's not a quick fix because a lot of the tools we depend on are the ones doing the overwriting. But you can work around it like so:
However, I believe the name conflict may not be the only thing here, because if gfm is the last format listed, the .md file should not be deleted. I believe it is deleted because keep-md is false for the two other format. Doing
When gfm is called last, its output index.md is existing, when cleaning step happen. This means the cleaning step for HTML and PDF format really remove the gfm format output.
So I wonder if a fix for this specific issue (before we manage to deal with intermediary conflict in naming) would be
gfm format should be last
cleaning step should happen after each rendering and not after all format rendering.
This also means that using keep-md: true in YAML header is also a good solution
I think the best workaround for now is to use a different output-file name for the gfm output. This is ultimately because quarto doesn't have a mechanism for tracking which formats use which filenames. (This is going to be fixable once we have #6518 taken care of in 1.5)
I do think here keep-md: true is good enough, and allow you to have md file named as input. I believe with gfm you sometime expect specific name like README.md from a .qmd file. So changing output-file would not give you that
Anyhow, both works, and I agree that it may be best to wait for #6518 big work to happen.
Still surprised of the cleaning up after all format renders though, and not between each format. Feels like there could be other conflict, but again #6518 will help.
Activity
cderv commentedon Sep 5, 2023
I believe this is a duplicate of this issue
Or at least same family as same cause mentioned by @cscheid in #1929 (comment)
Current workaround is using
output-file, but this means change thegfmoutput filename for now... not ideal.Other workaround is using
keep-md: truebut gfm needs to be the last format
However, I believe the name conflict may not be the only thing here, because if gfm is the last format listed, the .md file should not be deleted. I believe it is deleted because
keep-mdis false for the two other format. Doingas the same effect as previous one. So it seems that when rendering to all format, the last
keep-mdvalue is not applied.cderv commentedon Sep 5, 2023
Additional information from further debug to understand
Cleanup code is in
renderCleanup()quarto-cli/src/command/render/cleanup.ts
Lines 43 to 46 in f87976c
When rendering to
--to allwe pass through this 3 times, and not in the order I though.gfmformat would technically need to be firstquarto-cli/src/command/render/render-files.ts
Lines 671 to 683 in f87976c
When gfm is called last, its output
index.mdis existing, when cleaning step happen. This means the cleaning step for HTML and PDF format really remove the gfm format output.So I wonder if a fix for this specific issue (before we manage to deal with intermediary conflict in naming) would be
This also means that using
keep-md: truein YAML header is also a good solutioncscheid commentedon Sep 5, 2023
I think the best workaround for now is to use a different
output-filename for thegfmoutput. This is ultimately because quarto doesn't have a mechanism for tracking which formats use which filenames. (This is going to be fixable once we have #6518 taken care of in 1.5)cderv commentedon Sep 5, 2023
I do think here
keep-md: trueis good enough, and allow you to have md file named as input. I believe with gfm you sometime expect specific name like README.md from a .qmd file. So changingoutput-filewould not give you thatAnyhow, both works, and I agree that it may be best to wait for #6518 big work to happen.
Still surprised of the cleaning up after all format renders though, and not between each format. Feels like there could be other conflict, but again #6518 will help.
cscheid commentedon Sep 5, 2023
I think
keep-md: trueis only working by accident.Quarto doesn't know that two separate paths write a
.md:htmlandpdfoutput:.qmd->.md->.html.qmd->.mdI wouldn't rely on that.