Related, I recently cut "markdown_player@v1.2.0 | Deno" https://deno.land/x/markdown_player@v1.2.0 , but ocaml mdx lib seems to be likely more capable.
My slides and books are all "executable". I write them in restructured text and have tooling to either execute the code or build the output (in pdf, epub, mobi, slides).