code: function(sections, pathToSpec) {
      var deferred = Q.defer();
  
      // Parsing spec with JSdom
      jsdom.env(
          'http://127.0.0.1:' + global.opts.core.server.port + pathToSpec + '?internal=true',
          ['http://127.0.0.1:' + global.opts.core.server.port + '/source/assets/js/modules/sectionsParser.js'],
          function (err, window) {
              if (err) {
                  deferred.reject({
                      err: err,
                      msg: 'JSDOM error'
                  });
                  return;
              }
  
              var output = {};
  
              var SourceGetSections = window.SourceGetSections;
  
              var parser = new SourceGetSections();
              var allContents = parser.getSpecFull();
  
              if (sections) {
                  output = parser.getSpecFull(sections);
              } else {
                  output = allContents;
              }
  
              if (output) {
                  deferred.resolve({
                      output: output,
                      allContents: allContents
                  });
              } else {
                  deferred.reject({
                      msg: 'Requested sections HTML not found'
                  });
              }
          }
      );
  
      return deferred.promise;
  }
docs: TODO: Move to standalone API, for fast JSDOM spec parsing