Bugzilla – Bug 19543
Run Demo Code
Last modified: 2012-12-19 18:18:51 UTC
It has been brought up in IRC that we should have a way to allow for example code to actually be ran. This would be handy for things like CSS/HTML examples to display inline how things work.
Made a small prototype of how this could look like at http://www.youtube.com/watch?v=6Td2IJZSGwI
The code for this is at https://gist.github.com/4008670
We are looking into ways of doing this on-site. The reason being that the software we use needs to be Open Source and I don't see where codepen is. If their code is available for download then we could get it and use it locally. It looks like Dabblet  is what is being looked into to get tweaked and used for our needs currently.
Code is on https://github.com/remy/jsbin and is MIT Licensed.
Dabblet does not seem to currently support JS, it would need to be an addition made. JSbin seems nice but I have never really used it.
Lea is intending to add JS support to Dabblet before too long.
I'd like to second the request to be able to render live examples. I have a CSS-property manipulator framework that would work well on this site. I understand the difficulty hosting pages, so maybe s/b a contribution system?
I can see a particularly strong need for demos of emerging features. Question: Assuming JS support, can feature detection such as Modernizr be baked in so that each demo page doesn't have to provision this separately? a suggested developer interface would be a function accepting a list of test names like "cssmask" and "webaudio". Ideally end users could be directed towards a browser that supports all those features, but that might be more difficult.