quarto-dev / quarto-dev/quarto-cli

Embed is broken by period or underscore in the prefix of reference notebook

Open
#9,224 7 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Apr 2, 2024.

bug embed file-systems
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

In trying to embed a hidden notebook, I encountered an issue with the text parsing of the uri which leads to a NotFound Error due to the / being removed.

Using this reference: {{< embed ../../_cross_test.ipynb >}} led to:

PS C:\Users\dmley\OneDrive\Desktop\Sites\dmitriyleybel.github.io> quarto render
[1/5] about.qmd
[2/5] blog.qmd
[3/5] index.qmd
[4/5] posts\test_poast2\index.ipynb
ERROR: Rendering of output notebook produced an unexpected result
ERROR: NotFound: The system cannot find the file specified. (os error 2): readfile 'C:\Users\dmley\OneDrive\Desktop\Sites\dmitriyleybel.github.io_cross_test.ipynb'
Path: C:\Users\dmley\OneDrive\Desktop\Sites\dmitriyleybel.github.io_cross_test.ipynb

Stack trace:
Path: C:\Users\dmley\OneDrive\Desktop\Sites\dmitriyleybel.github.io_cross_test.ipynb
    at readTextFileSync (ext:deno_fs/30_fs.js:733:14)
    at Object.Deno.readTextFileSync (file:///C:/Program%20Files/Quarto/bin/quarto.js:5625:25)
    at Object.target (file:///C:/Program%20Files/Quarto/bin/quarto.js:38268:37)
    at fileExecutionEngineAndTarget (file:///C:/Program%20Files/Quarto/bin/quarto.js:41263:33)
    at renderFileInternal (file:///C:/Program%20Files/Quarto/bin/quarto.js:77120:42)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async renderFile (file:///C:/Program%20Files/Quarto/bin/quarto.js:77095:13)
    at async Object.renderOutputNotebook [as render] (file:///C:/Program%20Files/Quarto/bin/quarto.js:81477:22)
    at async Object.render (file:///C:/Program%20Files/Quarto/bin/quarto.js:81748:34)
    at async Object.renderPreviews (file:///C:/Program%20Files/Quarto/bin/quarto.js:109695:47)
Steps to reproduce
  1. Create a source notebook with either a _ or . prefix. e.g. _ref.ipynb, and let it live in a folder a directory or two away from the notebook you wish to render.
  2. Create a notebook to render(e.g. index.ipynb, and as one of the cells in the notebook, create a reference {{< embed ../../_ref.ipynb >}} to the source.
  3. Run quarto render Observe error
Expected behavior

No response

Actual behavior

No response

Your environment
  • IDE: VS Code 1.86.2
  • OS: Win11
  • Quarto: 1.4.551
Quarto check output
Quarto 1.4.551
[>] 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.551
      Path: C:\Program Files\Quarto\bin
      CodePage: 1252

[>] 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.11.3
      Path: C:/Users/dmley/AppData/Local/Programs/Python/Python311/python.exe
      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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.