library(finddxtemplate)

Create an HTML report

The html_document_find() function converts an .Rmd file to .html format. It admits toc, toc_depth, toc_float and code_folding arguments, similar to those of the rmarkdown::html_document() function, to control the appearance of the table of contents and code folding.

The html_document_find() function is called in the output_format argument of the rmarkdown::render() function.

# Store in temp file for the example
rmddir <- tempfile(pattern = "rmd-")
dir.create(rmddir)

# Knit
rmarkdown::render(input = system.file("rmarkdown", "rmd_template.Rmd", package = "finddxtemplate"), 
                  output_format = html_document_find(),
                  output_dir = rmddir)

# Open the knitted example
browseURL(file.path(rmddir, "rmd_template.html"))

Alternatively, you can change the output field in the YAML header of your .Rmd file:

---
title: "My report"
author: "Arthur Bréant"
date: "1/13/2022"
output: finddxtemplate::html_document_find
---

Add a logo in the HTML report

You can add a logo with through the logo field in the yml header of your .Rmd file. It takes the path to the image file. Here, the logo is the one saved in the {finddxtemplate} package:

logo: "`r system.file('logo', 'logo.svg', package = 'finddxtemplate')`"
---
title: "My report"
author: "Arthur Bréant"
date: "1/13/2022"
logo: "`r system.file('logo', 'logo.svg', package = 'finddxtemplate')`"
output: finddxtemplate::html_document_find
---