We have developed a method within our team to create branded reports from rmarkdown documents using custom CSS and HTML files. To maintain consistency, we utilize absolute paths to the style documents in our shared file structure. This allows us to easily copy the report documents into new folders and successfully knit them without any issues.
title: Example report header
subtitle: "`r params$study_name`"
author: "`r params$author_name`"
date: "`r format(Sys.Date(), '%B %d, %Y')`"
output:
html_document:
css: /absolute/path/to/css/style.css
highlight: null
includes:
in_header: /absolute/path/to/header/header.html
We want to share these .Rmd files with collaborators, but giving them access to our shared file structure is not feasible. We are looking for a solution where they can simply create copies of the .Rmd files without needing the style documents.
One approach we are considering is hosting the style documents on a public URL. However, we have not been able to determine if passing URLs into the header would work with native rmarkdown, or find any tools that claim to facilitate this process.
If anyone knows of a solution to this dilemma, we would greatly appreciate your input.