quarto-dev / quarto-dev/quarto-cli

including multiple files which contain ```jupyter: python3``` in the frontmatter block AND some actual code blocks, will print the content of subsequent the frontmatter block

Open
#10,436 10 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Aug 22, 2024.

bug engines-jupyter regression triaged-to
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

I bumped into an error upgrading to version 1.5.54 that regards including multiple qmd files with the {{< include >}} shortcode.

When I include multiple qmd files which contains in the raw block / frontamatter block at least the jupyter keyword, AND also a code block, then the raw block will be printed when rendered.

Here the link at the repo with a mwe

In summary the gist is this:

  • a couple of files are included into the main.qmd

# Preface {.unnumbered}

This is a Quarto book.

To learn more about Quarto books visit <https://quarto.org/docs/books>.


{{< include included_file.qmd >}}

{{< include included_file_2.qmd >}}
  • both included file have frontmatter/raw block
---
jupyter: python3
---


## Included File

a code block will trigger the error.

commenting the code block will not trigger the error

```{python}
x=1
```
---
jupyter: python3
---

## Included File 2

some text

The rendered result look like this:

image

I find out this working with the book type, where I may split a chapter into multiple section/files to be more manageable. Those files are usually qmd files converted from a ipynb so the frontmatter is written by default by the quarto convert cli.

In previous version (1.4.554) this was not happening, and I rely pretty much on the quarto convert tool to be able to work with ipynb, but actually render the converted qmd file. I've set up a pre-render command that will automatically convert each ipynb files in the folder into the corresponding qmd file, so I would appreciate if I don't need to edit again the converted qmd file, because conversion could happen several time during the writing phase.

Steps to reproduce
  1. render the provided document at the link
  2. comment out the code block in included_file.qmd to trigger the correct behavior (no raw matter printed)
Expected behavior

the content of the raw block should not be rendered, as it was the case with previous version of quarto.

Actual behavior

the content of the raw block get rendered into the final document

Your environment
  • win11
  • vscode
Quarto check output
Quarto 1.5.55
[>] 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.55
      Path: C:\Program Files\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: v2024.07.03
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\s.follador\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2024

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.12.4
      Path: C:/Users/s.follador/AppData/Local/pypoetry/Cache/virtualenvs/quarto-test-hTEtzXvo-py3.12/Scripts/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.