Now that you have imported your own data, it’s time to customize the report content and style.
Places to customize and change content are marked with the text
“EDIT:”. Find all edit markers in the RStudio project with
Ctrl + Shift + F to open the
Find in Files wizard.
Report metadata and options
The report metadata and options are set in the YAML and setup chunk
in 01_producer-report.qmd.
Start with the YAML (Yet Another Markup Language) header, which is
the content sandwiched between three dashes (---) at the
top of the file. It contains document metadata, parameters, and
customization options.
The only fields you need to edit are:
titleis what appears at the very top of the report. The logo appears above the title text (see the markdown primer for help with image syntax).subtitleappears below the title toward the right side.-
paramsdefine the parameter values used when iteratively rendering the report with the RStudioRenderbutton. They must be an existing combination of producer ID and year that have sample results in your data.producer_idchoose a producer ID in your data that you want to render the report for.yearchoose the year of the samples for the chosen producer ID to include in the report.
Example changed YAML
# EDIT: Replace logo.png in images folder with your own and add project name.
title: " The Best Soil Health Survey"
# EDIT: Subtitle right aligned below title.
subtitle: "Results from 2024"
# EDIT: Choose a valid producer_id/year combo that exists in your dataset.
params:
producer_id: "Sammy Sunflower"
year: 2024Ignore the other YAML fields and values until you would like to explore other ways of customizing your reports. Learn about the available YAML fields for HTML documents and MS Word documents.
Report content
01_producer-report.qmd uses the Quarto {{< include >}}
shortcode to embed content within the main parameterized report.
Edit the following Quarto files to fit your project and adjust/remove soil measurements that were tested.
├── 03_project-summary.qmd
├── 04_soil-health-background.qmd
├── 05_physical-measurements.qmd
├── 06_biological-measurements.qmd
├── 07_chemical-measurements.qmd
├── 08_looking-forward.qmd
Under the Project Results heading in
01_producer-report.qmd, update the sample depth:
All samples were collected from [EDIT: SOIL DEPTH (e.g. 0-6 inches, or 0-30 cm)].
01_producer-report.qmd calls
02_secion-template.qmd as a child document to generate a
section for each measurement_group defined in the
data-dictionary.csv. You shouldn’t need to edit
02_secion-template.qmd unless you want more advanced
customization.
Style and theme
The look and feel of your reports can be customized by changing the
fonts and colors to match your branding. The plot and table outputs are
controlled by the set-fonts-colors chunk in
01_producer-report.qmd. HTML reports are styled by the
styles.css file. MS Word reports are styled using the
word-template.docx template file.
set-fonts-colors chunk
The fonts and colors used in the tables and plots of the report are defined in this chunk. Change these values to match your own branding.
Style sheets
The style sheets can be found in the resources directory
and edited to customize the report appearance to match your own
branding.
HTML
styles.css controls the appearance of HTML reports.
Learn more about CSS.
/* Edit these :root variables */
:root {
--primary-color: #023B2C;
--secondary-color: #335c67;
--link-color: #a60f2d;
--light-color: #F2F0E6;
--fg-color: white; /* color for text with colored background*/
--heading-font: "Georgia";
--body-font: "Arial";
}
MS Word
Open word-template.docx and modify the styles according
to Quarto
documentation and Microsoft
documentation.
