Is anyone else using jsdoc-toolkit with Prototype.js? It works great
on plain 'ol JavaScript, but seems to have some problems using
Prototype 1.6-style classes and inheritance.
For example, if I do something like:
<code>
/**
* @class Foo
* @extends Bar
*/
Foo = Class.create(Bar, {
/**
* @constructor
*/
initialize : function() {
/**
* An important number
* @type Number
*/
this.important_number = 9999;
// do more stuff
},
/**
* This function does something else
* @return {Object} Something
*/
anotherFunction : function() {
...snip...
});
</code>
It has some problems:
1. I have to declare it as @class.
2. 'Bar' is not recognized as the superclass.
3. I have to declare initialize as @constructor.
4. The comments for the object properties (this.important_number)
(done either before or in the initialize method) do not show up at all
in the generated documentation.
5. anotherFunction() will not show up in the docs as a method of class
Foo.
I fully realize that jsdoc-toolkit was not designed with this use in
mind, and when this code is being parsed it appears to jsdoc that this
whole declaration was nothing more than a variable being assigned to
the result of a function.
I'm not complaining about jsdoc's inablility to handle this, just
wondering if anyone else was using jsdoc in this manner and had any
thoughts or advice on changing my coding style or the best way to go
about customizing jsdoc for this use.
If I can come up with a patch for jsdoc I would gladly share it if
anyone else is interested.
Thanks,
Nathan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---