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.
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? -
@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.
-
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!
-
Also, We publish the JSON version of our API docs through the dev center.
-
Anything new on this thread? Was a file compatible with Netbeans ever generated?
-
@Terry Wow, looks great. I'll hack a little Python script to create JSDoc from it… will report back.