Pkgdown: Include {.tabset} functionality in rendered articles

Created on 28 Feb 2019  路  5Comments  路  Source: r-lib/pkgdown

Is it possible to include {.tabset} style dropdowns in pkgdown articles? This would be helpful for creating visualization-heavy articles.

articles feature help wanted

Most helpful comment

The tabset classes are in the pkgdown vignette output, so I think we'd just need to copy the rmarkdown jquery plugin and some css into pkgdown.

Edit: actually it's more complicated that this, the markdown is processed in a specific way to generate tab contents, and pkgdown isn't doing that part. Because pkgdown uses html_document internally, it's probably doable, but will take some more digging.

All 5 comments

How does this work outside of pkgdown? That's the first problem to solve.

Here's an example of what I'm talking about in a standard rmd rendered to html

````r

title: "tabset test"
author: "Sean Hardison"
date: "3/1/2019"

output: html_document

Section X {.tabset}

X.1

```{r, echo = T}
plot(rnorm(30))



### X.2 

```{r, echo = T}
plot(rnorm(30))

````

The output looks like this:

image

Maybe this is already possible through pkgdown? Tabset syntax is ignored in pkgdown::build_articles() as far as I'm aware.

The tabset classes are in the pkgdown vignette output, so I think we'd just need to copy the rmarkdown jquery plugin and some css into pkgdown.

Edit: actually it's more complicated that this, the markdown is processed in a specific way to generate tab contents, and pkgdown isn't doing that part. Because pkgdown uses html_document internally, it's probably doable, but will take some more digging.

Is this still an outstanding feature? The tabsets are incredibly useful for building nice turorials.

I think unfortunately this is out of scope for pkgdown; in order to get the output of RMarkdown into pkgdown's templates we already have to do a lot of fiddly manipulation, so adding this feature is both difficult and likely to introduce unexpected issues further down the road.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maelle picture maelle  路  6Comments

privefl picture privefl  路  3Comments

ms609 picture ms609  路  6Comments

dfalbel picture dfalbel  路  10Comments

GegznaV picture GegznaV  路  9Comments