4 * Documentation - designed to generate HTML+Docbook!?!
6 Roo.doc = Roo.doc || {};
10 * @extends Roo.bootstrap.Component
11 * Entry Element class - describes a method etc...
12 * @cfg name {String} name of method
13 * @cfg purpose {String} short description of method.
17 * @param {Object} config The config object
22 Roo.doc.Entry = function(config){
23 Roo.doc.Entry.superclass.constructor.call(this, config);
24 //this.el = Roo.get(document.body);
25 var body = Roo.get(document.body);
35 // call onRender once... and block next call...?
38 //this.onRender = function() { };
42 Roo.doc.Entry._calls = 0;
44 Roo.extend(Roo.doc.Entry, Roo.bootstrap.Component, {
50 getAutoCreate : function(){
73 addxtype : function (tree, cntr)
75 return this.addxtypeChild(tree,cntr);
78 onRender : function(ct, position)
81 Roo.doc.Entry._calls++;
82 if (Roo.doc.Entry._calls > 1 || !ct) {
86 // call onRender once... and block next call...?
88 Roo.bootstrap.Component.prototype.onRender.call(this, ct, position);
101 * @class Roo.doc.Example
102 * @extends Roo.bootstrap.Component
103 * Example Element class
104 * @cfg {String} lang (phpcode|programlisting) section type.
109 * Create a new Synopsis
110 * @param {Object} config The config object
113 Roo.doc.Example = function(config){
114 Roo.doc.Example.superclass.constructor.call(this, config);
117 Roo.extend(Roo.doc.Example, Roo.bootstrap.Component, {
123 getAutoCreate : function(){
125 // no colour highlighting in here....
134 html : String.format('{0}',this.code).replace(/\n/g, '<br/>')
156 * @class Roo.doc.Para
157 * @extends Roo.bootstrap.Component
158 * Param Element class
162 * Create a new Paragraph
163 * @param {Object} config The config object
166 Roo.doc.Para = function(config){
167 Roo.doc.Para.superclass.constructor.call(this, config);
170 Roo.extend(Roo.doc.Para, Roo.bootstrap.Component, {
173 getAutoCreate : function(){
175 //?? this is the synopsis type....
177 // this is not very fancy...
185 if (this.parent().is_list) {
212 * @class Roo.doc.Param
213 * @extends Roo.bootstrap.Component
214 * Param Element class
215 * @cfg {bool} is_optional is the argument optional
216 * @cfg {String} type argument type
217 * @cfg {String} name name of the parameter
218 * @cfg {String} desc short description
219 * @cfg {String} defaultvalue default value
223 * @param {Object} config The config object
226 Roo.doc.Param = function(config){
227 Roo.doc.Param.superclass.constructor.call(this, config);
230 Roo.extend(Roo.doc.Param, Roo.bootstrap.Component, {
238 getAutoCreate : function(){
240 //?? this is the synopsis type....
243 if (this.parent().stype == 'parameter') {
254 html : this.type + ' ' + this.name
263 if (this.parent().stype == 'return') {
280 // this is not very fancy...
285 is_optional ? '[' : '',
289 this.defaultvalue == '' ? '' : ' = ',
291 ',' // not really.. but let's do it anyway...
316 * @class Roo.doc.Section
317 * @extends Roo.bootstrap.Component
318 * SectionElement class
319 * @cfg {String} stype (desc|parameter|return|note|example) section type.
322 * Create a new Synopsis
323 * @param {Object} config The config object
326 Roo.doc.Section = function(config){
327 Roo.doc.Section.superclass.constructor.call(this, config);
330 Roo.extend(Roo.doc.Section, Roo.bootstrap.Component, {
335 getAutoCreate : function(){
345 html : this.stype.charAt(0).toUpperCase() + this.stype.slice(1) //ucfirst
349 if (this.stype == 'parameter') {
351 // db package uses variable list here... - it results in dd/dl but the layout is messed up..
354 cls: 'itemizedlist roo-params'
361 getChildContainer : function(build_call)
364 if (this.stype == 'parameter') {
365 return this.el.select('.roo-params',true).first();
382 * @class Roo.doc.Synopsis
383 * @extends Roo.bootstrap.Component
384 * Synopsis Element class
385 * @cfg {String} returntype return value
386 * @cfg {String} name title really..
387 * @cfg {String} stype (function|constant)
390 * Create a new Synopsis
391 * @param {Object} config The config object
394 Roo.doc.Synopsis = function(config){
395 Roo.doc.Synopsis.superclass.constructor.call(this, config);
398 Roo.extend(Roo.doc.Synopsis, Roo.bootstrap.Component, {
405 getAutoCreate : function(){
409 cls : 'refsynopsisdiv',
418 cls : 'funcprototype',
420 this.returntype + ' ',
445 getChildContainer : function(build_call)
449 return this.el.select('.roo-params',true).first();