Skip to content

Appcelerator Titanium API definition file generator for TernJS

License

Notifications You must be signed in to change notification settings

x-cray/tern-titanium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tern-titanium

This small script generates Tern definition files from Appcelerator Titanium API documentation YAML files. Tern is code-analysis engine for JavaScript which adds intellisense capabilities to text editors, it uses definition files to autocomplete object model member names and infer their types.

How to use

Prerequisites

You should have tern already installed and text editor configured. Refer to tern docs.

Generating definition file

Clone tern-titanium repository:

$ git clone git@github.com:x-cray/tern-titanium.git

Then you'll need Titanium Mobile source code which can be obtained from titanium_mobile repository:

$ git clone git@github.com:appcelerator/titanium_mobile.git

Optionally, you may want to checkout specific titanium_mobile release:

$ cd titanium_mobile
$ git checkout 3_1_2_GA
$ cd ..

Run generate.py supplying path to source API documentation and output file:

$ tern-titanium/generate.py titanium_mobile/apidoc titanium.json

Copy generated titanium.json file to your project directory. Then create .tern-project file in project directory (refer to tern documentation) with the following contents:

{
	"libs": [
		"titanium",
		"ecma5"
	],
	"plugins": {
		"requirejs": {
			"baseURL": "./app",
			"paths": {}
		}
	}
}

Libs entry titanium tells tern to look for titanium.json in project directory first and then in tern distribution defs/ directory.

That's it. Now Titanium Mobile API autocomplete should work in your text editor.

Contribution

Pull requests and ideas are welcome.

About

Appcelerator Titanium API definition file generator for TernJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages