Ember component for RunKit embeds.
$ ember install ember-runkit
Add the RunKit embed library to your app/index.html
:
If you want to include the embed library on-demand, see On-Demand Sourcing.
Don't forget to check out the RunKit embed docs.
Specify the source code that the notebook will use.
If true
, the user will not be able to edit or run the embed.
If 'endpoint'
, the notebook will be run as an endpoint and a link to the served page will be shown.
Request a version or semver range for the node engine.
Provide a list of environment variables accessible in the notebook through process.env.
Provide a title for the notebook when opened on RunKit.
Provide a minimum height for the embed ('130px'
by default).
Specify the Unix time in milliseconds at which packages should resolved. Packages published after the date will be ignored.
Specify source code that is run before the main source. This code will not be shown in the embed.
Provide a callback that is run when the embed is loaded.
{{runkit-embed
source='console.log("Hello, world!")'
onLoad=(action 'onLoad')}}
Provide a callback that is run whenever the embed's URL changes.
{{runkit-embed
source='console.log("Hello, world!")'
onURLChanged=(action 'onURLChanged')}}
Provide a callback that is run whenever the embed is evaluated.
{{runkit-embed
source='console.log("Hello, world!")'
onEvaluate=(action 'onEvaluate')}}
If you don't want the client to download the embed library until embeds are needed, you can use ember-script-loader
to dynamically source the library on-demand.
Install by running:
$ ember install ember-script-loader
Then wrap the embed inside the script loader: