Documenting your code using ScriptDoc [edit]

This page gives some of the guidelines to think about when documenting your code using the Aptana ScriptDoc system.

Contents

Introduction

By using Aptana's ScriptDoc system to document your code, you enable Code Assist to work for your own code and not just the core JavaScript language and HTML DOM.

Instructions

Document your code by using documentation blocks. Follow the guidelines below to write your documentation blocks.

Basic Instructions

To document your code:

This example shows a basic documentation block for a getFoo() function:

/** 
* Gets the current foo 
* @param {String} fooId	The unique identifier for the foo.
* @return {Object}	Returns the current foo.
*/
function getFoo(fooID){
}

Ordering your tags

Add your tags in the following order, as appropriate:

Ordering multiple versions of the same tag

If you have multiple versions of the same tag (e.g. a function that takes multiple parameters), use the guidelines below to help you order them

@see #Constructor(Type, Type...)
@see #Constructor(Type id, Type id...)
@see #method(Type, Type,...)
@see #method(Type id, Type, id...)
@see Class
@see Class#field
@see Class#Constructor(Type, Type...)
@see Class#Constructor(Type id, Type id)
@see Class#method(Type, Type,...)
@see Class#method(Type id, Type id,...)
@see package.Class
@see package.Class#field
@see package.Class#Constructor(Type, Type...)
@see package.Class#Constructor(Type id, Type id)
@see package.Class#method(Type, Type,...)
@see package.Class#method(Type id, Type, id)
@see package

Related Topics