Use this function to embed a svelte app from a directory / file-path into your output document (needs to be html). Check out this article for the svelte-app setup: https://jmbuhr.de/svelteR/articles/svelteR.html

include_svelte(name, path, props, self_contained = TRUE)

Arguments

name

:: String, name of the svelte app, usually the same as the name of the directory

path

:: String, File path to the svelte-app publish directory. e.g. "svelte-app/docs" or "svelte-app/public"

props

:: List, An R list of properties passed to the svelte-app. Will be automatically converted to JSON.

self_contained

:: Boolean. By default, Rmarkdown's html_document is self contained, meaning it includes all images and external code automatically into one html file. Setting self_contained = FALSE will set the pandoc option "data-external='1'" on the source attributes of the svelte code, allowing the scripts and css to be linked-in externally instead of included in the one-file document.

Value

Code that is inserted into the output document