quarto-dev / quarto-cli

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

`quarto render` should prints resources not found as `quarto preview` (via web server) #10484

Open mcanouil opened 1 month ago

mcanouil commented 1 month ago

Take:

---
title: "Quarto Playground"
format: html
---

This is a playground for Quarto.

![An image](wrong/path/to/image.png){#fig-placeholder}
quarto renderquarto preview
````qmd pandoc to: html output-file: index.html standalone: true section-divs: true html-math-method: mathjax wrap: none default-image-extension: png metadata document-css: false link-citations: true date-format: long lang: en title: Quarto Playground Output created: index.html ```` ````qmd andoc to: html output-file: index.html standalone: true section-divs: true html-math-method: mathjax wrap: none default-image-extension: png metadata document-css: false link-citations: true date-format: long lang: en title: Quarto Playground Output created: index.html Watching files for changes Browse at http://localhost:3317/index.html /wrong/path/to/image.png (404: Not Found) ````

Currently, the "not found" is the result of the web server as --no-browser would lead to the same output as quarto render (as expected).

quarto preview index.qmd --no-browser
mcanouil commented 1 month ago

Workaround (not applicable in all cases): quarto render --embed-resources

cscheid commented 1 month ago

This should be done with a link checker, but won't ever be a fully general solution because an HTML page can make requests dynamically based on Javascript.