docs: function(refPath) {
  		var require = function(relModuleId) {
  			var moduleId = resolveModuleId(relModuleId, refPath),
  				module = getModule(moduleId);
  
  			if (!module) {
  				throw "Module not loaded";
  			}
  			else if (module.error) {
  				throw "Error loading module";
  			}
  
  			if (!module.exports) {
  				module.exports = {};
  				var moduleDir = moduleId.substring(0, moduleId.lastIndexOf('/')+1),
  					injects = module.injects,
  					args = [];
  
  				for (var i = 0, n = injects.length; i<n; i++) {
  					if (injects[i] == 'require') {
  						args.push(createRequireFunc(moduleDir));
  					}
  					else if (injects[i] == 'exports') {
  						args.push(module.exports);
  					}
  					else if (injects[i] == 'module') {
  						args.push(module.module);
  					}
  				}
  
  				module.factory.apply(null, args);
  			}
  			return module.exports;
  		};
  
  		require.ensure = function(deps, cb) {
  			ensureImpl(deps, cb, refPath);
  		};
  
  		if (_mainProgram != null) {
  			require.main = getModule(_mainProgram).module;
  		}
  
  		return require;
  	}