Search code examples
jsduck

Can jsduck be used to document code that doesn't use sencha frameworks?


I am exploring JavaScript documentation tools, and found JSDuck impressive. I noticed appcelerator titanium uses it as well. However, couldn't find much information on using it for documenting code that doesn't use Sencha's JavaScript Frameworks. Any suggestions on how and if it could be used for documenting any Javascript code?


Solution

  • JSDuck is heavily geared towards documenting Sencha Ext JS and Touch frameworks, however, it will work just fine with plain JavaScript too. You just won't be able to take advantage of the many ExtJS-specific auto-detection capabilities. But you will still have a fair amount of various auto-detection.

    For example the following doc-comments don't use any @class, @method, @property tags - all this information and more is inferred from code:

    /**
     * Docs for my class.
     */
    function MyClass {
    }
    /**
     * Docs for a method.
     * @param {String} p1 ...
     * @param {Number} p2 ...
     * @return {Object}
     */
    MyClass.prototype.foo = function(p1, p2) {};
    /**
     * Docs for a property.
     */
    MyClass.prototype.bar = "Hello";