Including media
The Embed()
expression may be used for embedding files and media into the program. Its default behavior is to return a data:
or external URL.
Embed("thumb.webp")
Note: When returning an external URL, implementations such as Jet Engine use the
app://
scheme to fetch a file in the application's installation directory. Implementations targetting HTML5 may choose to preload these files in a virtual file system.
Note: Implementations may support an artifact path interpolation, as in:
Embed("{target}/auto.generated")
That is useful when a build script is involved that generates files at the artifact path.
Including statically
The user may embed files statically as either application/text
(String
) or application/octet-stream
(ByteArray
), rather than obtaining a URL.
Embed("data.txt", static="application/text")
Embed("data.bin", static="application/octet-stream")