Skip to content

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 #10436

@kompre

Description

@kompre

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/

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingengines-jupyterAnything related to Jupyter engineregressionFunctionality that used to work but now is broken.triaged-toIssues that were not self-assigned, signals that an issue was assigned to someone.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions