quarto-dev / quarto-dev/quarto-cli

Link to source of embedded code cell doesn't work for `book` project

Open
#12,771 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug description

I followed the guide to embed code cells of another notebook. It correctly embeds the code and the output, but I cannot see the link to the source notebook when I work with a book project. It works properly if I set a website project.

This feature would be very useful when writing books with exercises and example notebooks that can be downloaded or run externally.

Steps to reproduce

_quarto.yml

project:
  type: book
  output-dir: _output

# website:
#   title: Quarto Test

#   navbar:
#     title: Quarto Test
#     left:
#       - href: index.qmd
#         text: Home
#       - href: introduction.qmd
#         text: Introduction
#       - href: some_notebook.qmd
#         text: Some Notebook

book:
  title: "Numerical Methods for Quantum Optics and Open Quantum Systems"
  author:
    - name: Alberto Mercurio
    - name: Daniele De Bernardis
  chapters:
    - index.qmd
    - introduction.qmd

# default format for all files
format:
  html:
    toc: true

jupyter: python3

execute:
  eval: true

introduction.qmd

# Introduction

Some text...

{{< embed some_notebook.qmd#some_code echo=true >}}

some_notebook.qmd

# Some Notebook

```{python}
#| label: some_code
import numpy as np

# Vectorized array operations
x = np.linspace(0, 10, 20)
y = np.sin(x) + 0.5 * x**2
print(y[:5])  # show first five results
```
Actual behavior

The code and the output are rendered properly, but no link to the source notebook is generated.

Expected behavior

A link to the source notebook, as for the website case.

Your environment
  • OS: MacOS Sequoia
Quarto check output
Quarto 1.7.31
[✓] Checking environment information...
      Quarto cache location: /Users/alberto/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.85.1: OK
      Deno version 1.46.3: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.7.31
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /Library/TeX/texbin
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.16 (Conda)
      Path: /opt/homebrew/Caskroom/miniconda/base/envs/computational-quantum-optics-lectures/bin/python
      Jupyter: 5.7.2
      Kernels: julia-1.11, julia-1.10, 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.

Research direction

Start by reproducing the behavior with _quarto.yml, introduction.qmd, and some_notebook.qmd, comparing the book and website project settings. Trace how the embedded cell and its output are rendered in each project type; done means the book output includes a link to the source notebook as the website output does.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.