millermedeiros / amd-utils

modular JavaScript utilities written in the AMD format
http://millermedeiros.github.com/amd-utils
142 stars 11 forks source link

add a way to test methods inside documentation #38

Closed millermedeiros closed 12 years ago

millermedeiros commented 12 years ago

sometimes I want to test the methods while outside an application, it would be great if docs had some sort or REPL like javascript sandbox console

millermedeiros commented 12 years ago

maybe it don't need to be as complex, just exposing all the methods in the global scope would be enough, like:

require(['../src/math'], function(math){
  window.utils.math = math;
});

and adding a comment somewhere in all the doc pages that you can access the methods on the browser console inside a namespace of the same name as the module name.