quarto-dev / quarto-dev/quarto-cli
generated figures with specified output file and directory are not found with html output
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
I'm trying to generate an html output with figures generated by python and specify the name of the output file and directory. When I do this, the html is broken and the image files do not link correctly.
For some background I would like to use quarto parameters with python to generate a series of web pages in a sub-directory for my project, which is a website. I'm trying to use the --output and --output-dir flags on the cli to specify the name of the output file instead of the template .qmd file that I created.
Steps to reproduce
See the following github repo: https://github.com/anielsen001/quarto-output-dir-files
Run this command:
quarto render demo/demo.qmd --output new_demo.html --output-dir _site/
view the output html in _site/new_demo.html in a browser.
If you do a simple quarto render on the entire project, then _site/demo/demo.html views properly in a browser.
I tried a second alternative:
quarto render demo/demo.qmd --output new_demo.html --output-dir _site/new_demo
This version generates an entire new website at _site/new_demo and the resulting _site/new_demo/new_demo.html is also broken.
Expected behavior
I expect to specify the name of an output file and directory for an html page and have the generated figures link correctly to the html page.
Actual behavior
The generated html does not link correctly to the figures and the additional css formatting is missing.
Your environment
editing in emacs, using cli to generate output, chrome to view html output
Quarto check output
Quarto 1.5.57
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.57
Path: /opt/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/bin
Version: 2019
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.1
Path: /home/apn/temp/output-name-test/venv/bin/python3
Jupyter: 5.7.2
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked quarto-output-dir-files reproduction and the CLI handling of --output and --output-dir. Compare the generated HTML, figure paths, and CSS with the working simple project render; done means the renamed HTML in the requested directory loads its figures and additional CSS correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python
- Domain
- cli, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100