Re: [Jsdoc-user] public properties?
Status: Inactive
Brought to you by:
mmathews
From: Michael M. <mi...@gm...> - 2007-03-28 06:25:37
|
Hi Anthony, You're looking on the wrong tagref page. Erm, OK, so JSDoc-2 doesn't yet have a "tagref" page... The property tag is mentioned on the new JSDoc-2 wiki, here... http://code.google.com/p/jsdoc-2/wiki/JsdocCookbook and here... http://code.google.com/p/jsdoc-2/wiki/JsLang The point is: JSDoc-2 is a complete rewrite of JSDoc 1.x, its still in beta, and has it's own project page. If you're willing to give us a hand you can try JSDoc-2 out and share your feedback. We expect to release a final 1.0 version of JSDoc-2 in July. I've gone ahead and posted a working example for you here... http://jsdoc.info/export/examples/fly/html/picky.html (choose the "anthony.js" library, with the "sunny" template) If you're not into beta you can stick with JSDoc 1.x -- it's not going away any time soon. I'm sure Gabriel, or one of the other JSDoc 1.x users will be able to help. Regards, Michael On 28 Mar 2007, at 00:33, Anthony Ettinger wrote: > On 3/27/07, Michael Mathews <mi...@gm...> wrote: >> Hi Anthony, >> >> I'm afraid I don't understand your example. Perhaps you trimmed too >> much, because the Foo.bar code you gave isn't valid JS. Did you mean: >> >> Foo = { >> bar: { >> some_public_property: 2, >> a_func: function(p) { >> } >> } >> }; >> >> Foo.bar.some_public_property = 3; >> >> I can't be certain of JSDoc 1.x (perhaps Gabriel will follow up) but >> in JSDoc-2 one way to document the above would be like so: >> >> /** >> * Container object. >> * @namespace >> */ >> Foo = { >> /** >> * Just an example. >> * @namespace >> * @property {number} some_public_property >> */ >> bar: { >> some_public_property: 2, >> /** >> * Here's an example method. >> * @method >> * @param p >> */ >> a_func: function(p) { >> } >> } >> }; >> >> This would add all your objects to the output. I can post an example >> of this on the web if you like and you can try it yourself. >> >> Regards, >> Michael >> >> On 27 Mar 2007, at 22:58, Anthony Ettinger wrote: >> >> > Is it bad form to have a public property? >> > I'm not seeing any way to note this in JSDoc. >> > >> > ie: >> > >> > Foo.bar: { >> > some_public_property: 2, >> > a_func: function(p) { >> > >> > } >> > } >> > >> > >> > Such that I can set it with: >> > >> > Foo.bar.some_public_property = 3; >> > >> > Seems we need a JSDoc "@public" notation. > > > I don't see @property anywhere in the #tagref page. > > > > -- > Anthony Ettinger > Ph: 408-656-2473 > http://chovy.dyndns.org/resume.html > http://utuxia.com/consulting |