mdBook
mdBook copied to clipboard
Consider alternative playpen backends for remote code execution
Currently the support for https://play.rust-lang.org/ is hardcoded into book.js. We might be interested to support alternative ones like
Like:
- https://play.integer32.com/ for rust
- https://rust.godbolt.org/ - compiler explorer is not a playpen pe se but it's immensely useful. (Also for other languages)
Also take into consideration support for other languages:
- https://play.golang.org/
- https://code.sololearn.com/#cpp
See https://fiddles.io/ for extended list
+1 for godbolt. I would like to present wandbox as common denominator here as well.
There's an easy workaround here:
mdbook init --theme
and edit book.js
to point to your custom playpen/playground (Rust only, mind you)
I'm really interested in getting this feature going - Mdbook is great but it'd be nice if we could hook into other playground code editors (like purescript, haskell, etc). I don't mind trying to implement this myself, does anyone have any suggestions as a good starting point?
@vanceism7 Haskell folks have created a public API for executing code:
- https://play.haskell.org
- https://github.com/haskell/play-haskell#api
Indeed, and we're also looking into integrating the Haskell playground into mdBook. :)