EmbedScript works by grabbing all HTML elements with the <es> tag, their types, and parses the specified script type into a <script> or the main tag for that script.
First, add the jsDelivr CDN.
<script async defer src="https://cdn.jsdelivr.net/gh/Anistick/[email protected]/latest.min.js"></script>To embed JavaScript, you need to use the <es> tag and pure-js type. An example is like so:
<es type="pure-js"></es>Next, add your JavaScript code.
<es type="pure-js">
console.log("Hello, World!");
</es>To embed Python, you still need to use the <es> tag (doesn't change) but using the py-script type. An example is like so:
<es type="py-script"></es>Next, add your Python code:
<es type="py-script">
print("Hello, World!")
</es>That's the basics! Python embedding uses PyScript. A demo of JavaScript is here. Python demo coming soon.