Extract client code into a plugin
After some discussion with Phil about how we could improve documentation for PureScript libraries, we arrived at a design where we would like to have GitHub Pages-hosted documents easily embed runnable PureScript snippets, with something like script or pre tags, and a plugin that adds a "Run" button, posts the code to the Try PS API when the user clicks, and finally renders the output (below the snippet).
I have not had time to look into how this code is doing stuff right now, just throwing this out there. :smile:
Thx!
👍 I think the simplest thing we can do here is to just extract the code which calls the service and runs the generated JS in an iframe, into its own JS library which can be included in documentation/blogs etc.
Hopefully I'll start working on this this week
Some stuff came up. May take a bit longer until I can work on this. Sorry.
No rush at all, thanks!
@paf31 @soupi this will be an awesome feature.
We can embed in documentation / help. Most importantly we can create something like a Notebook where people can type code and execute. Would be super useful for building Interactive training material ;)
I'm sorry I haven't implemented this yet. If anyone wants to pick this up they are welcomed to. It might take a bit of time until I can work on this.
let me try this next weekend