Embeding Code Editor

Hi @bLeDy and welcome to the forum.

This is certainly possible.
You can achieve this in the following way:

move your cdn scripts to native libraries
Create a custom HTML Form and paste some of the html/css/js…


<pre id="editor">def foo(items):
    for i in len(items):
        print("Ace Rocks", items[i])
</pre>

<script>
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/twilight");
    editor.session.setMode("ace/mode/python");
</script>

<style>
    #editor {
        margin: 0;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
    }
  </style>

Clone Link:
https://anvil.works/build#clone:3BELTE4C6AI7T3RD=WLNFPDS4JGPHL6GKSLOOIPCS

5 Likes