@lincyaw/slidev-addon-exec-wasi
v1.0.0-rc.0
Published
Presmium plugin: run C, C++, Ruby and SQLite programs in WebAssembly, in the browser and at build time
Readme
@lincyaw/slidev-addon-exec-wasi
Running C, C++, Ruby and SQL in WebAssembly, with the same runtime at build time and in the browser: no toolchain on the build machine, offline in the browser.
Part of Presmium, which turns lectures written in MyST Markdown into web pages, slides, Jupyter notebooks and narrated lectures.
Install
pnpm add -D @lincyaw/slidev-addon-exec-wasiList it in the headmatter of the documents that use it:
plugins:
- '@lincyaw/slidev-addon-exec-wasi'It is a Presmium plugin and a Slidev addon: its components work on the web page and in the slides. It needs @lincyaw/cli and the renderers in the same project, and declares the Presmium packages it shares with them as peer dependencies (Presmium 1.x).
What it provides
- The executor
presmium.wasifor code blocks inc,cpp,rubyandsql. - Named environments of
kind: wasi.
Configuration
presmium.execWasi.loadTimeoutMs: how long the browser may take to download a runtime (default 120000). Only code run in the browser makes the build publish the runtime (about 52 MB for C and C++).
Documentation
- Author guide (Chinese:
site/guide/lecture.md) - Directive reference (Chinese): every directive with its options and an example
License
Apache-2.0
