feat: Update export command to use --template-dir
and --template-param
#32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pairs with posit-dev/shinylive#144
Helps with posit-dev/shinylive#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.