This documentation is a WIP
The TDoc format follows a simple syntax for declaring Modules, Proxies, Methods, Properties, and Events for Titanium.
The documentation tree starts in the Titanium folder, and generally follows this pattern:
Titanium/ -- Module/ ---- Module.tdoc ---- Proxy.tdoc ---- SubModule/ ------ SubModule.tdoc
A TDoc file basically consists of sections, and properties, and allows for free-form Markdown in most places.
A section usually looks like:
- SECTION section content
- namespace (full namespace of the object)
- type (module, proxy, view, property, method)
- description (a full length description)
- since (what version of Titanium this object was added in)
- platforms (android,iphone,ipad)
- notes (special notes for this object)
- example (named code examples)
- methods (list of method names and descriptions)
- method (section for a single method with parameters and return type)
- properties (list of property names, types, and descriptions)
- events (events fired by this proxy or module)
- event (section for a single event with event object properties)
The method, event, and example sections all support embedded names, and in the case of the method section also supports a return type. Some quick examples:
# returns void - method : helloWorld # returns string - method : methodName, string method documentation.. - event : eventName event documentation.. - example : My Cool Example <code> // here's some code.. </code>
Section Properties generally take the form:
name[type]: value
Method parameters are defined as properties under a Method section. Titanium types can be auto-link by surrounding the full API Name (using Titanium instead of Ti) using backticks. For example:
- method : format, string formatString[string]: The format string args[array,...]: The format arguments - method : createTableView, `Titanium.UI.TableView` returns a new table view - method : updateRow row[`Titanium.UI.TableViewRow`]: row to update
Defined as properties under the Properties section, and can also auto-link Titanium types with backticks, For example:
- properties name[string]: Name documentation myView[`Titanium.UI.View`]: my view
Except in the special cases of Properties and Method Parameters, you can generate a link to a Titanium type by surrounding it with double brackets, like so:
- description Creates a [[Titanium.UI.TableView]]