quarto-dev / quarto-dev/quarto

Revealjs preview (within VS Code) often does not go to current slide, most notably when `slide-level` is set in project- or directory- level YAML

Open
#374 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
645
Forks
62
Avg merge
17h 42m
Merged PRs (30d)
13

Description

Hi there, I have experienced quite a bit of trouble with getting Quarto in VS Code to navigate to the current revealjs slide. After a bit of testing, I believe I have identified the source of the problem. It is similar to issue #6409 in the quarto-dev/quarto-cli repo, but involves the slide-level YAML option. I am unsure if this persists to, say, RStudio.

I also found some other behavior which tripped me up in finding the root of the issue, which I have included at the end.

Primary Issue:

If

---
format: 
   revealjs:
      slide-level: 3
---

Is located in either _quarto.yml or _metadata.yml, the slide preview in VS Code reverts to a different slide than the one I am currently on (e.g. looking at, previously edited, or @ cursor position). I think it processes the heading tags (##) in a weird way, because it is hard to pin down the exact behavior for an ideal MRE.

If the slide-level: 3 is located in the document YAML, however, it seems that everything is (mostly) fine. The MRE at the end should work to reproduce this, provided that slide-level: 3 is removed from the document and placed in a _quarto.yml or _metadata.yml within the project. Of course, this is replaced at the document level with format: revealjs.


Software Info:

  • VS Code version: 1.86.0
  • Quarto extension version: v1.110.1
  • OS: Linux Mint 21.3
  • Output of quarto check:
Quarto 1.4.549
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.549
      Path: /opt/quarto/bin

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

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/cwiegand/.TinyTeX/bin/x86_64-linux
      Version: 2023

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

[✓] Checking Python 3 installation....OK
      Version: 3.11.6 (Conda)
      Path: /home/cwiegand/miniconda3/bin/python
      Jupyter: 5.5.0
      Kernels: python3

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

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /usr/lib/R
      LibPaths:
        - /home/cwiegand/R/x86_64-pc-linux-gnu-library/4.3
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.45
      rmarkdown: 2.25

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

Other Strange Behavior

Here is some other interesting behavior I found along the way. See MRE for reference. Some of these could be inferred from reading the pandoc manual, but I wanted to include them here for documentation's sake.

Default "issues":
  1. No YAML title, manual # <title-slide>,
    • Slide preview is one (1) slide ahead of cursor
  2. YAML title, no # <title-slide>, yes <!-- <html-comment> --> before first slide
    • Slide preview is one (1) slide behind cursor
  3. YAML title, manual # <title-slide>, <!-- <html-comment> --> before the title slide
    • Slide preview is one (1) slide behind cursor
slide-level: 3 (within document YAML) "issues":
  1. Without a YAML title, no html comments, optional # title slide or ## section slide
    • Slide preview is 1 slide ahead of cursor
  2. With a YAML title, no manual # title slide, but an html comment before first slide (even a section slide)
    • Slide preview is 1 slide behind cursor
  3. With a YAML title and manual # title slide, but an html comment before title slide
    • Slide preview is 1 slide ahead of cursor

MRE (document level):
---
format: 
    revealjs: 
        slide-level: 3
title: "test"
---

<!-- html-comment -->

# title

## section

### Slide 1

- content

### Slide 2
- list

### Slide 3
update

### Slide 4 
The end

Contributor guide

No contributing guide indexed for this repository

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 MRE in VS Code with slide-level: 3 in the document, then move it to _quarto.yml or _metadata.yml and compare the preview location with the cursor's current slide. Done means the preview navigates to the current slide in the project- or directory-level configuration while preserving the documented behavior for document-level configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
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.