Closed micouy closed 2 years ago
I don't think it is possible for a web page to launch executables on the local system without using an extension or something like that. Also, mdbook is currently hard-coded to only use play.rust-lang.org (#350).
I might recommend checking out something like evcxr for interactive evaluation of Rust. That still requires running jupyter locally, though.
I think no matter what approach you take, you'll either need the user to install something on their system, or hosting your own server that provides a playground-like experience.
Okay, thanks.
Is there a way to use the local installation of Rust to do it?
As @ehuss said, you cannot directly use a Rust installation.
However, you can run the Playground locally (or on a server you control): https://github.com/integer32llc/rust-playground#development. Then override the play.rust-lang.org
URLs in book.js
for your course. You get the book.js
file by running mdbook init --theme
.
@micouy Perhaps leave this feature request open since it isn't really resolved yet? Or do you consider it a duplicate of #350?
Sometimes I get a timeout error when running Rust code. I'm currently preparing a Rust course with editable examples and I expect my students to re-run their code a lot. Is there a way to use the local installation of Rust to do it? I'd be willing to add a custom preprocessor and I'm open to hacky solutions.