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 ? '[' : '',
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(){
348 html : Roo.doc.Section.map[this.stype]
352 if (this.stype == 'parameter') {
354 // db package uses variable list here... - it results in dd/dl but the layout is messed up..
357 cls: 'itemizedlist roo-params'
364 getChildContainer : function(build_call)
367 if (this.stype == 'parameter') {
368 return this.el.select('.roo-params',true).first();
378 Roo.doc.Section.map = {
379 'desc' : 'Description',
380 'parameter' : 'Parameters',
381 'return' : 'Return Value',
383 'example' : 'Examples'
391 * @class Roo.doc.Synopsis
392 * @extends Roo.bootstrap.Component
393 * Synopsis Element class
394 * @cfg {String} returntype return value
395 * @cfg {String} name title really..
396 * @cfg {String} stype (function|constant)
399 * Create a new Synopsis
400 * @param {Object} config The config object
403 Roo.doc.Synopsis = function(config){
404 Roo.doc.Synopsis.superclass.constructor.call(this, config);
407 Roo.extend(Roo.doc.Synopsis, Roo.bootstrap.Component, {
414 getAutoCreate : function(){
418 cls : 'refsynopsisdiv',
427 cls : 'funcprototype',
429 this.returntype + ' ',
455 getChildContainer : function(build_call)
459 return this.el.select('.roo-params',true).first();