quarto-dev / quarto-r

R interface to quarto-cli
https://quarto-dev.github.io/quarto-r/
142 stars 22 forks source link

Custom Quarto Extension/Template for Vignette Building #166

Open jan-abel-inwt opened 5 months ago

jan-abel-inwt commented 5 months ago

Hi there, I just tested the feature of building vignettes with Quarto, and it works seamlessly!

I read this article which states that the following configuration can't be overridden:

format: 
  html:
    theme: none
    minimal: true
    embed-resources: true
    css: custom.css

I'm wondering how to build a vignette with my own custom Quarto extension/template. Is this possible?

cderv commented 5 months ago

This is for more advanced usage, but you can use the special engine

%\VignetteEngine{quarto::format}

which will do whatever is configured in format key.

This is not yet fully documented as this is quite advanced usage to me and I am not yet sure of the possible side effect of creating vignette this way. They will use Quarto default if no format key is provided, and they are not meant for lightweight document which we usually expect for vignettes.

I'll add a note in documentation though to get more feedback on this.

Tips: To see all engine in a package you can do

library(quarto)
names(tools::vignetteEngine(package = "quarto"))
#> [1] "quarto::format" "quarto::html"   "quarto::pdf"
jan-abel-inwt commented 5 months ago

Thanks a lot! It's working smoothly with our internal corporate design templates (pdf/html).

cderv commented 5 months ago

Awesome !