asciidoctor / asciidoctor-extensions-lab

A lab for testing and demonstrating Asciidoctor extensions. Please do not use this code in production. If you want to use one of these extensions in your application, create a new project, import the code, and distribute it as a RubyGem. You can then request to make it a top-level project under the Asciidoctor organization.
Other
104 stars 101 forks source link

Create an extension to execute JavaScript code in the browser #60

Open ggrossetie opened 8 years ago

ggrossetie commented 8 years ago

This could be really useful when writing documentation for a JavaScript library. The extension will search for JavaScript source code blocks and add a link/button "Run this code in your browser" to execute the code and print the result in the browser.

mojavelinux commented 8 years ago

This is something I've always envisioned being part of the source block. Perhaps we can add an "interactive" option to source block and use a Treeprocessor to add a "run this code" button and output area. That way, it wouldn't just be specific to JavaScript (though we could start there).

mojavelinux commented 8 years ago

Interesting to note that we might be able to support Ruby execution via Opal :)