This PR adds template_dir and template_params to shinylive.export() and as command line arguments in shinylive export.
template_dir or --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 or --template-params takes a dict of template parameters (in Python) or a JSON string or path to JSON in the CLI. 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.
We now also use mustache for templating via chevron to render the templates. In addition to being a more powerful templating engine, this also allows us to use the same template logic for both R and Python. chevron appears to be under-maintained but stable and recommended from the mustache frontpage.
Pairs with https://github.com/posit-dev/shinylive/pull/144 Helps with https://github.com/posit-dev/shinylive/issues/110
This PR adds
template_dir
andtemplate_params
toshinylive.export()
and as command line arguments inshinylive export
.template_dir
or--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
or--template-params
takes a dict of template parameters (in Python) or a JSON string or path to JSON in the CLI. 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.We now also use mustache for templating via chevron to render the templates. In addition to being a more powerful templating engine, this also allows us to use the same template logic for both R and Python. chevron appears to be under-maintained but stable and recommended from the mustache frontpage.