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);
34 // call onRender once... and block next call...?
36 //this.onRender = function() { };
40 Roo.doc.Entry._calls = 0;
42 Roo.extend(Roo.doc.Entry, Roo.bootstrap.Component, {
48 getAutoCreate : function(){
71 addxtype : function (tree, cntr)
73 return this.addxtypeChild(tree,cntr);
77 onRender : function(ct, position)
80 Roo.doc.Entry._calls++;
81 if (Roo.doc.Entry._calls > 1 || !ct) {
85 // call onRender once... and block next call...?
87 Roo.bootstrap.Component.prototype.onRender.call(this, ct, position);
100 * @class Roo.doc.Example
101 * @extends Roo.bootstrap.Component
102 * Example Element class
103 * @cfg {String} lang (phpcode|programlisting) section type.
108 * Create a new Synopsis
109 * @param {Object} config The config object
112 Roo.doc.Example = function(config){
113 Roo.doc.Example.superclass.constructor.call(this, config);
116 Roo.extend(Roo.doc.Example, Roo.bootstrap.Component, {
122 getAutoCreate : function(){
124 // no colour highlighting in here....
133 html : String.format('{0}',this.code).replace(/\n/g, '<br/>')
155 * @class Roo.doc.Para
156 * @extends Roo.bootstrap.Component
157 * Param Element class
161 * Create a new Paragraph
162 * @param {Object} config The config object
165 Roo.doc.Para = function(config){
166 Roo.doc.Para.superclass.constructor.call(this, config);
169 Roo.extend(Roo.doc.Para, Roo.bootstrap.Component, {
172 getAutoCreate : function(){
174 //?? this is the synopsis type....
176 // this is not very fancy...
184 if (this.parent().is_list) {
211 * @class Roo.doc.Param
212 * @extends Roo.bootstrap.Component
213 * Param Element class
214 * @cfg {bool} is_optional is the argument optional
215 * @cfg {String} type argument type
216 * @cfg {String} name name of the parameter
217 * @cfg {String} desc short description
218 * @cfg {String} defaultvalue default value
222 * @param {Object} config The config object
225 Roo.doc.Param = function(config){
226 Roo.doc.Param.superclass.constructor.call(this, config);
229 Roo.extend(Roo.doc.Param, Roo.bootstrap.Component, {
237 getAutoCreate : function(){
239 //?? this is the synopsis type....
242 if (this.parent().stype == 'parameter') {
253 html : this.type + ' ' + this.name
262 if (this.parent().stype == 'return') {
279 // this is not very fancy...
284 is_optional ? '[' : '',
288 this.defaultvalue == '' ? '' : ' = ',
290 ',' // not really.. but let's do it anyway...
315 * @class Roo.doc.Section
316 * @extends Roo.bootstrap.Component
317 * SectionElement class
318 * @cfg {String} stype (desc|parameter|return|note|example) section type.
321 * Create a new Synopsis
322 * @param {Object} config The config object
325 Roo.doc.Section = function(config){
326 Roo.doc.Section.superclass.constructor.call(this, config);
329 Roo.extend(Roo.doc.Section, Roo.bootstrap.Component, {
334 getAutoCreate : function(){
344 html : this.stype.charAt(0).toUpperCase() + this.stype.slice(1) //ucfirst
348 if (this.stype == 'parameter') {
350 // db package uses variable list here... - it results in dd/dl but the layout is messed up..
353 cls: 'itemizedlist roo-params'
360 getChildContainer : function(build_call)
363 if (this.stype == 'parameter') {
364 return this.el.select('.roo-params',true).first();
381 * @class Roo.doc.Synopsis
382 * @extends Roo.bootstrap.Component
383 * Synopsis Element class
384 * @cfg {String} returntype return value
385 * @cfg {String} name title really..
386 * @cfg {String} stype (function|constant)
389 * Create a new Synopsis
390 * @param {Object} config The config object
393 Roo.doc.Synopsis = function(config){
394 Roo.doc.Synopsis.superclass.constructor.call(this, config);
397 Roo.extend(Roo.doc.Synopsis, Roo.bootstrap.Component, {
404 getAutoCreate : function(){
408 cls : 'refsynopsisdiv',
417 cls : 'funcprototype',
419 this.returntype + ' ',
444 getChildContainer : function(build_call)
448 return this.el.select('.roo-params',true).first();