-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4d8a24
commit a60d790
Showing
8 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
latest/docs/dist/website/doxygen/latex/vs-templ_8hpp__dep__incl.pdf
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
latest/docs/dist/website/doxygen/latex/vs-templ_8hpp__incl.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<html> | ||
|
||
<head> | ||
</head> | ||
|
||
<body> | ||
<h1>This demo is being implemented!</h1> | ||
<p> | ||
It actually works, but if you don't plan on working via the web console there is not much to see :D.<br /> | ||
Please come back later :) | ||
</p> | ||
<script type="module"> | ||
import { WASI, File, OpenFile, ConsoleStdout, PreopenDirectory } from "https://unpkg.com/@bjorn3/[email protected]/dist"; | ||
|
||
let args = ["bin", "template.xml", "data.xml"]; | ||
let env = ["FOO=bar"]; | ||
let fds = [ | ||
new OpenFile(new File([])), // stdin | ||
ConsoleStdout.lineBuffered(msg => console.log(`[WASI stdout] ${msg}`)), | ||
ConsoleStdout.lineBuffered(msg => console.warn(`[WASI stderr] ${msg}`)), | ||
new PreopenDirectory(".", [ | ||
["data.xml", new File(new TextEncoder("utf-8").encode(`<a></a>`))], | ||
["template.xml", new File(new TextEncoder("utf-8").encode(`<b></b>`))], | ||
]), | ||
]; | ||
let wasi = new WASI(args, env, fds); | ||
console.log(wasi) | ||
const data = new Uint8Array(await (await fetch("https://github.com/lazy-eggplant/vs.templ/releases/latest/download/vs.templ.js")).arrayBuffer()) | ||
|
||
const res = new Response(data, { headers: [["Content-Type", "application/wasm"]] }) | ||
const module = new WebAssembly.Module(data); | ||
const instance = new WebAssembly.Instance(module, { | ||
"wasi_snapshot_preview1": wasi.wasiImport | ||
}); | ||
console.log(instance); | ||
//console.log(instance.exports.process("<a></a>", "<b></b>")); | ||
wasi.start(instance); | ||
</script> | ||
</body> | ||
|
||
</html> |