Loading lib/jsduck/app.rb +10 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ module JsDuck @timer.time(:generating) { write_members(@output_dir+"/output/members.js", relations) } @timer.time(:generating) { write_class(@output_dir+"/output", relations) } @timer.time(:generating) { write_overview(@output_dir+"/output/overviewData.js", relations) } @timer.time(:generating) { write_examples(@output_dir+"/output/exampleData.js") } if @guides_dir @timer.time(:generating) { write_guides(@guides_dir, @output_dir+"/guides", relations) } end Loading Loading @@ -223,6 +224,15 @@ module JsDuck File.open(filename, 'w') {|f| f.write(js) } end # Write examples in JSON form into a file. def write_examples(filename) overview = JSON.parse(IO.read(@template_dir+"/exampleData.json")) js = "Docs.examplesData = " + JSON.generate( overview ) + ";" File.open(filename, 'w') {|f| f.write(js) } end # Writes documentation page for each class # We do it in parallel using as many processes as available CPU-s def write_pages(path, relations) Loading template/app/controller/Classes.js +14 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,10 @@ Ext.define('Docs.controller.Classes', { ref: 'overview', selector: 'classoverview' }, { ref: 'tabPanel', selector: 'classtabpanel' }, { ref: 'tree', selector: 'classtree' Loading Loading @@ -190,9 +194,19 @@ Ext.define('Docs.controller.Classes', { }, showClass: function(cls, anchor) { var classOverview = this.getTabPanel().down('classoverview'); if (this.currentCls != cls) { this.getViewport().setPageTitle(cls.name); this.getHeader().load(cls); if (!classOverview) { classOverview = Ext.create('Docs.view.cls.Overview'); this.getTabPanel().add(classOverview); this.getTabPanel().setActiveTab(0); } classOverview.load(cls); this.getOverview().load(cls); this.getOverview().setLoading(false); Loading template/app/model/Example.js 0 → 100644 +11 −0 Original line number Diff line number Diff line /** * Key-value pairs of Docs app settings. */ Ext.define('Docs.model.Example', { fields: ['id', 'primaryClass', 'referencesClasses', 'title', 'description'], extend: 'Ext.data.Model', proxy: { type: 'memory', id : 'docs-examples' } }); template/app/store/Examples.js 0 → 100644 +7 −0 Original line number Diff line number Diff line /** * Store for keeping examples index. */ Ext.define('Docs.store.Example', { extend: 'Ext.data.Store', model: 'Example' }); No newline at end of file template/app/view/Viewport.js +2 −11 Original line number Diff line number Diff line Loading @@ -6,8 +6,7 @@ Ext.define('Docs.view.Viewport', { extend: 'Ext.container.Viewport', requires: [ 'Docs.view.cls.Header', 'Docs.view.cls.Overview', 'Docs.view.cls.Container', 'Docs.view.index.Container', 'Docs.view.tree.Tree', 'Docs.view.ClassGrid', Loading Loading @@ -203,15 +202,7 @@ Ext.define('Docs.view.Viewport', { classData: Docs.overviewData }, { xtype: 'container', layout: { type: 'vbox', align: 'stretch' }, items: [ {xtype: 'classheader'}, {xtype: 'classoverview', flex: 1} ] xtype: 'classcontainer' }, { autoScroll: true, Loading Loading
lib/jsduck/app.rb +10 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ module JsDuck @timer.time(:generating) { write_members(@output_dir+"/output/members.js", relations) } @timer.time(:generating) { write_class(@output_dir+"/output", relations) } @timer.time(:generating) { write_overview(@output_dir+"/output/overviewData.js", relations) } @timer.time(:generating) { write_examples(@output_dir+"/output/exampleData.js") } if @guides_dir @timer.time(:generating) { write_guides(@guides_dir, @output_dir+"/guides", relations) } end Loading Loading @@ -223,6 +224,15 @@ module JsDuck File.open(filename, 'w') {|f| f.write(js) } end # Write examples in JSON form into a file. def write_examples(filename) overview = JSON.parse(IO.read(@template_dir+"/exampleData.json")) js = "Docs.examplesData = " + JSON.generate( overview ) + ";" File.open(filename, 'w') {|f| f.write(js) } end # Writes documentation page for each class # We do it in parallel using as many processes as available CPU-s def write_pages(path, relations) Loading
template/app/controller/Classes.js +14 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,10 @@ Ext.define('Docs.controller.Classes', { ref: 'overview', selector: 'classoverview' }, { ref: 'tabPanel', selector: 'classtabpanel' }, { ref: 'tree', selector: 'classtree' Loading Loading @@ -190,9 +194,19 @@ Ext.define('Docs.controller.Classes', { }, showClass: function(cls, anchor) { var classOverview = this.getTabPanel().down('classoverview'); if (this.currentCls != cls) { this.getViewport().setPageTitle(cls.name); this.getHeader().load(cls); if (!classOverview) { classOverview = Ext.create('Docs.view.cls.Overview'); this.getTabPanel().add(classOverview); this.getTabPanel().setActiveTab(0); } classOverview.load(cls); this.getOverview().load(cls); this.getOverview().setLoading(false); Loading
template/app/model/Example.js 0 → 100644 +11 −0 Original line number Diff line number Diff line /** * Key-value pairs of Docs app settings. */ Ext.define('Docs.model.Example', { fields: ['id', 'primaryClass', 'referencesClasses', 'title', 'description'], extend: 'Ext.data.Model', proxy: { type: 'memory', id : 'docs-examples' } });
template/app/store/Examples.js 0 → 100644 +7 −0 Original line number Diff line number Diff line /** * Store for keeping examples index. */ Ext.define('Docs.store.Example', { extend: 'Ext.data.Store', model: 'Example' }); No newline at end of file
template/app/view/Viewport.js +2 −11 Original line number Diff line number Diff line Loading @@ -6,8 +6,7 @@ Ext.define('Docs.view.Viewport', { extend: 'Ext.container.Viewport', requires: [ 'Docs.view.cls.Header', 'Docs.view.cls.Overview', 'Docs.view.cls.Container', 'Docs.view.index.Container', 'Docs.view.tree.Tree', 'Docs.view.ClassGrid', Loading Loading @@ -203,15 +202,7 @@ Ext.define('Docs.view.Viewport', { classData: Docs.overviewData }, { xtype: 'container', layout: { type: 'vbox', align: 'stretch' }, items: [ {xtype: 'classheader'}, {xtype: 'classoverview', flex: 1} ] xtype: 'classcontainer' }, { autoScroll: true, Loading