quarto-dev / quarto-dev/quarto-cli

Including qmd that uses jupyter, yaml top matter gets dumped into render doc sometimes

Open
#7,157 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug description

When including a qmd in another document (outer document). If...

  • the included qmd executes python, and
  • the included document sets a title in its yaml topmatter, and
  • the outer document uses pandoc's ```{=markdown} syntax, and
  • the outer document does not set a title in its yaml topmatter

Then the yaml for the included qmd gets dumped into the rendered outer document.

Steps to reproduce

run quarto render outer.qmd --to gfm with the files below

outer.qmd

---
---

```{=markdown}
[![CI](https://github.com/machow/quartodoc/actions/workflows/ci.yml/badge.svg)](https://github.com/machow/quartodoc/actions/workflows/ci.yml)
```

{{< include inner.qmd >}}

inner.qmd

---
title: The inner title
some_yaml_option: 1
jupyter:
  kernelspec: python3
---

```{python}
1 + 1
```

output

# kernelspec: python3

[![CI](https://github.com/machow/quartodoc/actions/workflows/ci.yml/badge.svg)](https://github.com/machow/quartodoc/actions/workflows/ci.yml)

------------------------------------------------------------------------

title: The inner title some_yaml_option: 1 jupyter:

``` python
1 + 1
```

    2
Expected behavior

yaml topmatter not included in output

Actual behavior

yaml topmatter in output (see example for output)

Your environment

Mac OS

Quarto check output
Quarto 1.4.398
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.8: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.4: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.398
      Path: /Applications/quarto/bin

[✓] 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.9.5
      Path: /Users/machow/.pyenv/versions/3.9.5/bin/python3
      Jupyter: 5.3.1
      Kernels: ..SNIPPED..

[✓] Checking Jupyter engine render....OK

(|) Checking R installation...........R scripting front-end version 4.1.2 (2021-11-01)
[✓] 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.

Research direction

Reproduce the problem with the provided outer.qmd and inner.qmd files by running quarto render outer.qmd --to gfm. Trace the handling of included documents, Python/Jupyter execution, and YAML top matter; done means the rendered outer document no longer contains the inner document's YAML.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, python
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.