2011-08-26 22 views
6

JavaScript'te jsDoc ile ad alanları nasıl belgelenebilir?JavaScript'te ad alanları nasıl belgelenir?

İşte benim denemem, bu doğru mu?

/** 
* My special namespace 
* 
* @name my.namespace 
* @namespace 
*/ 
$namespace('my.namespace', /** @lends my.namespace **/ { 
    /** 
    * Foo - does something really neat... 
    * @function 
    */ 
    foo: function() { 
    } 
}); 

Sadece aşağıdaki gibi yukarıdaki kullanılır netleştirmek için:

my.namespace.foo(); 
+0

Bu gerçekten eski olduğunu biliyorum tarafından yapıldı jsdoc-araç (jsdoc2)

farklıdır, ama merak ediyorum. $ Namespace 'sizinkilerden özel bir şey mi? –

cevap

8

Bu özellik jsdoc3 micmath/jsdoc mevcuttur. jsdoc3 sözdizimi Aşağıdaki örnek Michael jsdoc and pseudo-namespaces?

/** 
* Document me. 
* @namespace my 
*/ 

/** 
* My special namespace 
* @namespace my.namespace 
*/ 
$namespace('my.namespace', /** @lends my.namespace **/ { 
    /** 
    * Foo - does something really neat... 
    */ 
    foo: function() { 
    } 
}); 
İlgili konular