mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-13 16:00:37 -05:00
WIP: Bringing PyScript.next PoC to the main project (#1507)
* kill unwrapped_remote (#1490) * kill unwrapped_remote * linting * don't use callKwargs for python plugins * fix tests and improve types * Bringing PyScript.next PoC to the main project * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Madhur Tandon <20173739+madhur-tandon@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4467898473
commit
339e40063a
34
pyscript.core/test/plugins/lua.html
Normal file
34
pyscript.core/test/plugins/lua.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<title>Plugins</title>
|
||||
<style>
|
||||
py-script {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<script type="importmap">
|
||||
{ "imports": { "@pyscript/core": "../../min.js" } }
|
||||
</script>
|
||||
<script type="module">
|
||||
import { registerPlugin } from "@pyscript/core";
|
||||
registerPlugin("lua-script", {
|
||||
type: "wasmoon", // or just 'lua'
|
||||
async onRuntimeReady(element, wasmoon) {
|
||||
// Somehow this doesn't work in Wasmoon
|
||||
wasmoon.io.stdout = (message) => {
|
||||
console.log("🌑", wasmoon.type, message);
|
||||
};
|
||||
wasmoon.run(element.textContent);
|
||||
element.replaceChildren("See console ->");
|
||||
element.style.display = "block";
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<lua-script> print('Hello Console!') </lua-script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user