Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Are there plans for providing developers with a JSDoc enriched dummy file?

I did this for Titanium 0.8.x by hand and tried to develop a parser for your HTML documentation on codestrong … but then you switched to the new API documentation on appcelerator.com and I would have to rewrite the whole parser.

So I'm asking you whether you could provide us with a JSDoc file for all Titanium (esp. Ti Mobile) functions. As you already parse your source code to generate the HTML documentation, this shouldn't really be a problem for you.

It should look somewhat like this:

/**
 * @package Titanium
 * @subpackage Media
 */
Titanium.Media = {
    /**
     * Play an audio alert using the system default notification.
     * Causes the system to make an alert noise and/or vibrate
     * @since 0.4
     */
    'beep': function() { },

    /**
     * Creates a Sound object.
     * @param url (string) url to sound
     * @return (Titanium.Media.Sound) the sound object
     * @since 0.4
     */
    'createSound': function( url ) { return new Titanium.Media.Sound(); },

    /**
     * Start the camera for capturing an image.
     * Presents the camera interface to the user to let them take a photo
     * @param options (Object) hash/dictionary for camera options
     * @since 0.4
     */
    'showCamera': function( options ) { }
};

We could then just include this file into our projects in our favorite IDE to have full parameter and function hints aka. auto-completion aka. IntelliSense aka. code completion.

— asked April 1st 2010 by Markus Birth
  • api
  • docs
  • documentation
  • ide
  • jsdoc
  • mobile
0 Comments

6 Answers

  • @Markus Take a look at apicovereage.json. This should be what you need to develop your own singleton, bundle, etc. Care to share your creation?

    — answered April 1st 2010 by TZ Martin
    permalink
    0 Comments
  • @Terry Please take a look at http://wiki.birth-online.de/know-how/software/titanium … I did not yet try the resulting file while programming, but will do so soon.

    — answered April 2nd 2010 by Markus Birth
    permalink
    0 Comments
  • Hey there @Markus, awesome idea with doing the stub parsing off the JSON model.

    What I'm trying to do here is create a Global Javascript Library for NetBeans 6.8 to parse.

    To start, I followed your genapidoc.py instructions and got the resulting JSDoc stub file (refered here as "Ti.js")…

    I then put the Ti.js file in a zip file and then referenced it as an external Global JS library in NetBeans 6.8. Now when I'm in my Titanium project in NetBeans and open a javascript file and type "Titanium." NetBeans gives me the correct top-level object list from the Ti.js file.

    (YAY!)

    The problem is that when I then select a sub-object/method nothing comes up in the code completion menu (e.g. "Titanium.UI.cre" should give me a list with all of the "create*" methods, but doesn't).

    (Boooo!)

    I tested this method with the JQuery and ExtJS libraries and it works fine, but those are complete libs and not stubbed libs.

    Was wondering if it had something to do with the stubbed methods that have returns not actually have the the "return new {someConstructor};} return stub in the Ti.js file.

    Any ideas? I'll keep investigating on this end, but any suggestions would be great!

    — answered April 29th 2010 by Jean-Etienne LaVallee
    permalink
    0 Comments
  • Anything new on this thread? Was a file compatible with Netbeans ever generated?

    — answered September 15th 2010 by Dan Wilson
    permalink
    0 Comments
  • @Terry Wow, looks great. I'll hack a little Python script to create JSDoc from it… will report back.

    — answered April 2nd 2010 by Markus Birth
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.