inst/templates/examplereport/README.md

To create a report...

  1. Create a folder called and in that folder:
  2. body.mustache - report's custom body template
  3. custom.css - reports custom css (to be applied over global/shared css)
  4. custom.js - any javascript for the report
  5. css.imports - line separated list of relative paths to CSS files to import (should be relative to shared/libs)
  6. js.imports - line separated list of relative paths to JS files to import (should be relative to shared/libs)
  7. partials - directory which should contain mustache templates. These templates should be available to the body.mustache template using the file's name with the file extension (eg: partial.mustache will be available as {{>partial}})
  8. Define the report class and add class overrides :
  9. define report class in 02-templating-class.R by adding setClass('reportName') to the classes section.
  10. -data.R ** Define override for parseCustomDataElementsForTemplate function - function will do custom data parsing and build a list object with data which will be available to the templates in reportData
  11. -render.R ** Define override for renderCustomFragments - function which will do any custom rendering, return a named list of rendered HTML fragments. The named list will be available to the templates in renderedFragments

All templates MUST have the .mustache extension.



USGS-R/repgen documentation built on April 14, 2021, 2:47 p.m.