contents shortcode not working with altair plot

Open
#12,078 3 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Feb 19, 2025.

Assessment

This issue has not been assessed yet.

Description

bug early-in-release engines-jupyter shortcodes
Discussed in https://github.com/quarto-dev/quarto-cli/discussions/12075

Originally posted by laguill February 13, 2025

Description

Hello,

I am trying to rearrange the output of a chart made with altair.
As followed here https://quarto.org/docs/authoring/contents.html

The output is not displayed.
Is it only working with matplotlib ?

---
title: Rearrange altair chart content
format: html
---

## A section

Here we define a plot.

```{python}
#| echo: false
#| label: a-cell

import altair as alt
from vega_datasets import data

source = data.iowa_electricity()
alt.Chart(source).mark_area(opacity=0.3).encode(x="year:T", y=alt.Y("net_generation:Q").stack(None), color="source:N")
```

## Another section

Here we use the plot, inside a callout:

::: callout-note

## Note the following plot

{{< contents a-cell >}}

:::

``` </div>
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

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.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.