Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 722 Bytes

Embed.md

File metadata and controls

29 lines (25 loc) · 722 Bytes

How to embed our application

Demo

https://codepen.io/jcruz7/pen/dmERwj

Getting started

  1. Download our latest release here.
  2. Move the JavaScript bundle into your project.
  3. In your html document add the following:
<body>
+  <div id="root"></div>
+  <script type="text/javascript" src="coconut-interpreter.bundle.js"></script>
</body>

Set initial code

<script>
  initialCode = '42 |> print';
</script>

Note: this must be before <div id="root"></div>!

Dynamically set code

setCode('def fish() = 1 + 1');

Note: this replaces the existing code!