build/updates/builder.js
function (cb, data, layout) {
            var self = this;

            Y.prepare([DEFAULT_THEME, themeDir], self.getProjectMeta(), function (err, opts) {
                if (err) {
                    console.log(err);
                }
                if (!data.name) {
                    return;
                }

                opts.meta = Y.merge(opts.meta, data);

                opts.meta.title = self.data.project.name;
                opts.meta.moduleName = data.name;
                opts.meta.projectRoot = '../';
                opts.meta.projectAssets = '../assets';
                opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts);

                opts = self.populateClasses(opts);
                opts = self.populateModules(opts);
                opts = self.populateFiles(opts);

                opts.meta.fileName = data.name;
                fs.readFile(opts.meta.fileName, Y.charset, Y.rbind(function (err, str, opts, data) {
                    if (err) {
                        Y.log(err, 'error', 'builder');
                        cb(err);
                        return;
                    }

                    if (typeof self.options.tabspace === 'string') {
                        str = str.replace(/\t/g, self.options.tabspace);
                    }

                    opts.meta.fileData = str;
                    var view = new Y.DocView(opts.meta, 'index');
                    var mainLayout = opts.layouts[layout];
                    self.render('{{>files}}', view, mainLayout, opts.partials, function (err, html) {
                        self.files++;
                        cb(html, view, data);
                    });

                }, this, opts, data));
            });

        }
function (cb, data, layout) {
            var self = this;

            Y.prepare([DEFAULT_THEME, themeDir], self.getProjectMeta(), function (err, opts) {
                if (err) {
                    console.log(err);
                }
                if (!data.name) {
                    return;
                }

                opts.meta = Y.merge(opts.meta, data);

                opts.meta.title = self.data.project.name;
                opts.meta.moduleName = data.name;
                opts.meta.projectRoot = '../';
                opts.meta.projectAssets = '../assets';
                opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts);

                opts = self.populateClasses(opts);
                opts = self.populateModules(opts);
                opts = self.populateFiles(opts);

                opts.meta.fileName = data.name;
                fs.readFile(opts.meta.fileName, Y.charset, Y.rbind(function (err, str, opts, data) {
                    if (err) {
                        Y.log(err, 'error', 'builder');
                        cb(err);
                        return;
                    }

                    if (typeof self.options.tabspace === 'string') {
                        str = str.replace(/\t/g, self.options.tabspace);
                    }

                    opts.meta.fileData = str;
                    var view = new Y.DocView(opts.meta, 'index');
                    var mainLayout = opts.layouts[layout];
                    self.render('{{>files}}', view, mainLayout, opts.partials, function (err, html) {
                        self.files++;
                        cb(html, view, data);
                    });

                }, this, opts, data));
            });

        }
function ( cb , data , layout ) { var self = this ; Y . prepare ( [ DEFAULT_THEME , themeDir ] , self . getProjectMeta ( ) , function ( err , opts ) { if ( err ) { console . log ( err ) ; } if ( ! data . name ) { return ; } opts . meta = Y . merge ( opts . meta , data ) ; opts . meta . title = self . data . project . name ; opts . meta . moduleName = data . name ; opts . meta . projectRoot = '../' ; opts . meta . projectAssets = '../assets' ; opts . meta . projectLogo = self . _resolveUrl ( self . data . project . logo , opts ) ; opts = self . populateClasses ( opts ) ; opts = self . populateModules ( opts ) ; opts = self . populateFiles ( opts ) ; opts . meta . fileName = data . name ; fs . readFile ( opts . meta . fileName , Y . charset , Y . rbind ( function ( err , str , opts , data ) { if ( err ) { Y . log ( err , 'error' , 'builder' ) ; cb ( err ) ; return ; } if ( typeof self . options . tabspace === 'string' ) { str = str . replace ( / \t / g , self . options . tabspace ) ; } opts . meta . fileData = str ; var view = new Y . DocView ( opts . meta , 'index' ) ; var mainLayout = opts . layouts [ layout ] ; self . render ( '{{>files}}' , view , mainLayout , opts . partials , function ( err , html ) { self . files ++ ; cb ( html , view , data ) ; } ) ; } , this , opts , data ) ) ; } ) ; }
Render the source file
@method renderFile
@param {Function} cb The callback fired when complete
@param {String} cb.html The HTML to render this view
@param {Object} cv.view The View Data
Render the source file