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 this.is_optional ? '[' : '',
292 this.defaultvalue == '' ? '' : ' = ',
294 this.is_optional ? ']' : '',
295 ',' // not really.. but let's do it anyway...
320 * @class Roo.doc.Section
321 * @extends Roo.bootstrap.Component
322 * SectionElement class
323 * @cfg {String} stype (desc|parameter|return|note|example) section type.
326 * Create a new Synopsis
327 * @param {Object} config The config object
330 Roo.doc.Section = function(config){
331 Roo.doc.Section.superclass.constructor.call(this, config);
334 Roo.extend(Roo.doc.Section, Roo.bootstrap.Component, {
339 getAutoCreate : function(){
352 html : Roo.doc.Section.map[this.stype]
356 if (this.stype == 'parameter') {
358 // db package uses variable list here... - it results in dd/dl but the layout is messed up..
361 cls: 'itemizedlist roo-params'
368 getChildContainer : function(build_call)
371 if (this.stype == 'parameter') {
372 return this.el.select('.roo-params',true).first();
382 Roo.doc.Section.map = {
383 'desc' : 'Description',
384 'parameter' : 'Parameters',
385 'return' : 'Return Value',
387 'example' : 'Examples'
395 * @class Roo.doc.Synopsis
396 * @extends Roo.bootstrap.Component
397 * Synopsis Element class
398 * @cfg {String} returntype return value
399 * @cfg {String} name title really..
400 * @cfg {String} stype (function|constant)
403 * Create a new Synopsis
404 * @param {Object} config The config object
407 Roo.doc.Synopsis = function(config){
408 Roo.doc.Synopsis.superclass.constructor.call(this, config);
411 Roo.extend(Roo.doc.Synopsis, Roo.bootstrap.Component, {
418 getAutoCreate : function(){
422 cls : 'refsynopsisdiv',
431 cls : 'funcprototype',
433 this.returntype + ' ',
459 getChildContainer : function(build_call)
463 return this.el.select('.roo-params',true).first();