ker/com/x-code/x-code.com.js
function restrictToSection( code, section ) {
  var linesToKeep = [];
  var outOfSection = true;
  var lookFor = '#(' + section + ')';

  code.split('\n').forEach(function( line ) {
    if (outOfSection) {
      if (line.indexOf( lookFor ) > -1) {
        outOfSection = false;
      }
    } else {
      if (line.indexOf( lookFor ) > -1) {
        outOfSection = true;
      } else {
        linesToKeep.push( line );
      }
    }
  });

  return linesToKeep.join('\n');
}
function restrictToSection( code, section ) {
  var linesToKeep = [];
  var outOfSection = true;
  var lookFor = '#(' + section + ')';

  code.split('\n').forEach(function( line ) {
    if (outOfSection) {
      if (line.indexOf( lookFor ) > -1) {
        outOfSection = false;
      }
    } else {
      if (line.indexOf( lookFor ) > -1) {
        outOfSection = true;
      } else {
        linesToKeep.push( line );
      }
    }
  });

  return linesToKeep.join('\n');
}
function restrictToSection ( code , section ) { var linesToKeep = [ ] ; var outOfSection = true ; var lookFor = '#(' + section + ')' ; code . split ( '\n' ) . forEach ( function ( line ) { if ( outOfSection ) { if ( line . indexOf ( lookFor ) > - 1 ) { outOfSection = false ; } } else { if ( line . indexOf ( lookFor ) > - 1 ) { outOfSection = true ; } else { linesToKeep . push ( line ) ; } } } ) ; return linesToKeep . join ( '\n' ) ; }
it can be useful to restrict the display to just a section of the entire file.
Such sections must start with the following line where we find it's name.
Look at the definition of the section `init` in the following example.

@example
var canvas = $.elem( this, 'div' );
// #(init)
var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
gl.clearColor(0.0, 0.3, 1.0, 1.0);
gl.enable(gl.DEPTH_TEST);
gl.depthFunc(gl.LEQUAL);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
// #(init)
it can be useful to restrict the display to just a section of the entire file . Such sections must start with the following line where we find it s name . Look at the definition of the section init in the following example .