rfortherestofus/pagedreport

How best expose stylistic parameters of a template to users?

Opened this issue · 0 comments

Before asking my question, let me say how much I appreciate the work that you've done for this package. Not only is the package itself useful in its own right, but the package's code and templates helpfully sketch how one might create one's own pagedown wrapper/template.

Inspired by pagedreport, I'm planning to develop my own pagedown template, and perhaps a package for more easily making stylistic changes to the template (e.g., colors for select page elements).

With that in mind, a few questions:

  • What style parameters are already exposed. In a few videos (e.g., the last one here), you specify main-color as a parameter in the YAML. Is this something pagedreport exposes? Or is this something that pagedown exposes? In both cases, where can find a list of all such parameters like this?
  • How best to expose new style paramters. With pagedreport, you made decisions about what parameters to expose for each template (e.g., img_to_dark in the windmill). Where in the tech stack should would-be developers intervene to pass user-provided style parameters to templates? For example, if one wanted let users dictate the color in the @top-left area of the page margin?

For the last bullet, let me expand somewhat. In the past, you have provided some tips/leads for how to effect customization by passing the values of R variables to CSS variables (e.g. here and around 16:47 here). Is this still the best way to expose style parameters of templates (i.e., via CSS vars)?