template/util/template.js
function example() {
  return function(data, render) {
    var output = '.. code-block:: javascript\n';
    var lines = render(data).split('\n');
    logger.debug('line-0', data);
    if (lines.length && lines[0].match(/^<caption>.*<\/caption>$/)) {
      output += '   :caption: ' + lines.shift().slice(9, -10) + '\n';
    }
    output += '\n';
    for (var i = 0; i < lines.length; i++) {
      output += '   ' + lines[i] + '\n';
    }
    return render(output);
  };
}
function example() {
  return function(data, render) {
    var output = '.. code-block:: javascript\n';
    var lines = render(data).split('\n');
    logger.debug('line-0', data);
    if (lines.length && lines[0].match(/^<caption>.*<\/caption>$/)) {
      output += '   :caption: ' + lines.shift().slice(9, -10) + '\n';
    }
    output += '\n';
    for (var i = 0; i < lines.length; i++) {
      output += '   ' + lines[i] + '\n';
    }
    return render(output);
  };
}
function example ( ) { return function ( data , render ) { var output = '.. code-block:: javascript\n' ; var lines = render ( data ) . split ( '\n' ) ; logger . debug ( 'line-0' , data ) ; if ( lines . length && lines [ 0 ] . match ( / ^<caption>.*<\/caption>$ / ) ) { output += '   :caption: ' + lines . shift ( ) . slice ( 9 , - 10 ) + '\n' ; } output += '\n' ; for ( var i = 0 ; i < lines . length ; i ++ ) { output += '   ' + lines [ i ] + '\n' ; } return render ( output ) ; } ; }
Format a code example.
@return {string} the example output
Format a code example .