Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vignette engines for Quarto #146

Merged
merged 30 commits into from
Jan 31, 2024
Merged

Vignette engines for Quarto #146

merged 30 commits into from
Jan 31, 2024

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Jan 30, 2024

follow up on #57 and closes #136

HTML vignette

We want to produce a minimal HTML vignette (disable bootstrap and various features and provide custom CSS) so that the HTML produced is always right size for CRAN. This has the effect of most features using Bootstrap to no be available.

We do this in a way that introduces a limitation when "authoring" as only when building package, will vignettes have the real output format. When rendering with Quarto directly (through CLI or IDE), the default format: html will be used.

  • Insure that .Rbuildignore handles the various rendering artifacts when in this author mode

This is because we don't pass by a Format extensions to create the vignette format.

Posibble improvement in IDE or Quarto CLI itself could make the user experience better. (this is for another time though)

PDF vignette

Initial community work on #57 has PDF vignette. So it seems this could be useful to have directly.

However, I am thinking of a generic quarto vignette engine that would build whatever is in format. This would be up to the user to provide the right configuration for CRAN, but it would open the door to typing vignettes and more. We would have the HTML vignette engine to insure good default and minimal HTML, and the other for any customization needed.

It also depends on what version of Quarto CRAN has available.

  • Check Quarto version available

cderv and others added 20 commits January 30, 2024 16:52
And mock function to test no quarto installed
Size of package's file on CRAN is limited and controled. quarto:html engine should provide a lightweight version by default

* embed-resources: true -> a single HTML file as vignette
* minimal: true & theme: 'none' -> no boostrap related feature
* a custom CSS based on rmarkdown::html_vignettes()

Setting those metadata means it won't be possible to overwrite as they are overrinding any in YAML header settings.
R will check for engine at build time.
https://github.com/wch/r-source/blob/ed93ccd03e1bfa5794348faf32bfd1bc4aa3d547/src/library/tools/R/build.R#L283-L285

Causing error
```
Error in loadVignetteBuilder(pkgdir, TRUE) :
  vignette builder 'quarto' not found
```
[skip ci]
@cderv cderv merged commit 1cb0f5a into main Jan 31, 2024
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.

Using Quarto for creating vignettes
2 participants