Skip to contents

Render xaringan or Quarto slides as an html file. In generally, it is the same thing as rmarkdown::render() or quarto::quarto_render() except that the self_contained option is forced to TRUE if the HTML file is built into a directory other than the one containing from.


to_html(from, to = NULL, self_contained = FALSE, render_args = NULL)



Path to an .Rmd or .qmd file.


The name of the output file. If using NULL then the output file name will be based on file name for the from file. If a file name is provided, a path to the output file can also be provided.


Should the output file be a self-contained HTML file where all images, CSS and JavaScript are included directly in the output file? This option, when TRUE, provides you with a single HTML file that you can share with others, but it may be very large. This feature is enabled by default when the to file is written in a directory other than the one containing the from R Markdown file.


A list of arguments passed to rmarkdown::render() or quarto::quarto_render().


Slides are rendered as an .html file.


with_example("slides.Rmd", {
    # Render html from Rmd file
#>  Rendering slides.Rmd into slides.html
#>  Rendering slides.Rmd into slides.html ... done