Closed trosel closed 7 years ago
That already exists: glot.io
Perl6.Party uses it. Click on any code example and you can modify/run it: http://perl6.party/post/Perl-6-S---Substitution-Operator
Did you just embed the glot.io iframe in your blog? Under the share link?
<iframe src='https://glot.io/snippets/emfuaraio4/embed' frameborder='0' scrolling='no' sandbox='allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts' width='600' height='400'></iframe>
for example ^
That's another way of doing it, yes.
You can also use Glot.IO's API too (we got a module). Perl6.party just uses it under the hood to get execution results and uses codemirror on the frontend to turn any code block into an editable+executable box.
Similar to the interpreter/compiler system built into Rust By Example
This service could then be re-used by a number of tutorials / books.