Cleanup: moved LiveCodeEditor into a macro

This commit is contained in:
Anand Chitipothu
2021-03-09 11:51:09 +00:00
parent 480774755f
commit 13030b0b9b
2 changed files with 24 additions and 23 deletions

View File

@@ -0,0 +1,22 @@
{% macro LiveCodeEditor(name, code) %}
<div class="canvas-editor row no-gutters" id="editor-{{name}}">
<div class="col-sm">
<div class="heading">
<button class="run">Run</button>
<h2>Editor</h2>
</div>
<textarea class="code">{{code}}</textarea>
</div>
<div class="col-sm">
<div class="heading">
<h2>Output</h2>
</div>
<div class="canvas-wrapper">
<canvas class="canvas" width="300" height="300"></canvas>
<pre class="output"></pre>
</div>
</pre>
</div>
</div>
{% endmacro %}