Interactive textbooks are valuable tools when teaching programming languages. However, existing solutions typically require a server to execute code interactively, which can be costly for either writers or readers. LupBook addresses this issue by providing a new framework that runs entirely on the clients’ side, functioning offline and offering a truly free interactive textbook experience.
You can get access to the latest build here: https://gitlab.com/luplab/lupbook/pandoc-lupbook/-/jobs/artifacts/main/file/build/book.html?job=build. You’ll need to click on the provided link in order to run the interactive textbook in your browser.
LupBook’s code base is available at: https://gitlab.com/luplab/lupbook. There are two main pieces in LupBook:
The Virtual Machine (VM), available at https://gitlab.com/luplab/lupbook/lupbook-vm.
The VM is the one providing the “interactive coding” activities of the framework. It runs the code that readers write locally (instead of sending it to an online server like in the other interactive textbook frameworks).
Internally, the VM emulates a complete RISC-V hardware system (https://gitlab.com/luplab/lupbook/lupbook-emu), which get initialized with a bootloader (https://gitlab.com/luplab/lupbook/riscv-pk), and then runs the Linux kernel (https://gitlab.com/luplab/lupbook/linux) and a full userland stack (https://gitlab.com/luplab/lupbook/buildroot).
The VM is compiled to webassembly and comes with a JS API. It is later embedded in the HTML textbook.
The LupBook authoring framework per se, available at https://gitlab.com/luplab/lupbook/pandoc-lupbook.
Authors write their textbooks using the popular, lightweight format Markdown. They have access to extensions that LupBook provides in order to write interactive activities as part of their books, such as interactive coding, multiple-choice questions, fill-in-the-blanks questions, matching problems, Parsons problems, etc.
The markdown source code of the textbook is then compiled into a single, self-contained HTML file which can be easily distributed to readers.