Adds template_dir and template_params to shinylive::export().
template_dir allows users to customize the index.html file used by the exported app. This argument takes a path that, effectively, supercedes the path in the shinylive assets.
template_params takes a list of template parameters. https://github.com/posit-dev/shinylive/pull/144/files introduces a new set of template params, e.g. {{ title }}. This argument also covers parameters introduced by custom templates, or future parameters added to the default shinylive template.
I initially used glue::glue() for the interpolation, but realized while working on the Python side of this change that that it won't be easy to replicate glue's interpolation behavior in Python.
Instead, I decided to use whisker so that both implementations can use mustache for templating. I think this is a net win, as it allows for more powerful templating for power users without overly complicating the feature.
Fixes #32 Pairs with https://github.com/posit-dev/shinylive/pull/144
Adds
template_dir
andtemplate_params
toshinylive::export()
.template_dir
allows users to customize theindex.html
file used by the exported app. This argument takes a path that, effectively, supercedes the path in the shinylive assets.template_params
takes a list of template parameters. https://github.com/posit-dev/shinylive/pull/144/files introduces a new set of template params, e.g.{{ title }}
. This argument also covers parameters introduced by custom templates, or future parameters added to the default shinylive template.I initially used
glue::glue()
for the interpolation, but realized while working on the Python side of this change that that it won't be easy to replicate glue's interpolation behavior in Python.Instead, I decided to use
whisker
so that both implementations can use mustache for templating. I think this is a net win, as it allows for more powerful templating for power users without overly complicating the feature.