Skip to content

Support tabsets in quarto articles - #3026

Open
roaldarbol wants to merge 1 commit into
r-lib:mainfrom
roaldarbol:feature/quarto-panel-tabsets
Open

roaldarbol wants to merge 1 commit into
r-lib:mainfrom
roaldarbol:feature/quarto-panel-tabsets

Conversation

@roaldarbol

Copy link
Copy Markdown

Quarto renders ::: {.panel-tabset} as markup for tabby.js, which pkgdown doesn’t include. tweak_tabsets() matched any class containing tabset, so it also picked up .panel-tabset and turned it into a single broken tab.

This PR:

  • matches the tabset class exactly, on <div> or <section>, so ## Heading {.tabset} now also works in quarto articles;
  • converts Quarto panel tabsets to the same Bootstrap 5 tabs used for R Markdown, respecting the default tab and .nav-pills;
  • adds unit tests plus an end-to-end quarto test, a NEWS bullet, and a tabset example in vignettes/quarto.qmd.

Grouped tabsets (group=) display as independent tabsets; syncing them would need JS and could be a follow-up. @BjarkeHautop has a related post-processing approach in quartofix.

This PR was made with AI assistance (Claude Code); I have reviewed the changes.

Fixes #2951

Quarto's `::: {.panel-tabset}` produces markup for tabby.js, which pkgdown doesn't include. `tweak_tabsets()` matched any class *containing* `tabset`, so it picked up `.panel-tabset` and mangled it into a single broken tab. Now:

* `tweak_tabsets()` matches the `tabset` class exactly, on a `<div>` (R Markdown) or `<section>` (Quarto), so `## Heading {.tabset}` also works in quarto articles.
* New `tweak_panel_tabset()` converts Quarto panel tabsets to Bootstrap 5 tabs, respecting the default tab (`data-tabby-default`) and `.nav-pills`.

Fixes r-lib#2951.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tabset support for quarto vignette

1 participant