An approach for how to embed functional code which can be referred to from any location in the text and activated by the user.
Required:
@code{
source = {the actual code goes here, over as many lines as needed},
}
Optional:
@code{
show-lines = {xx}, (how many lines of code to show at the location in the doc on export)
language = {xxx},
execution-environment = {xxx},
requirements = {xxx},
xr = {xx}, (yes, no)
vr = {xx}, (yes, no)
ar = {xx} (yes, no)
roomscale = {xx}, (yes, no)
seated = {xx}, (yes, no)
repository = {xxx}, (full code if needed)
resources = {xxx}, (url to 3d or other resources to run)
license = {xx},
author = {xx}, (author of the code)
author-contact = {xx},
source = {the actual code goes here, over as many lines as needed},
}
@{code-end}