AS2Doc - API Documentation Generator

Home Download Support
AS2Doc TagsFAQDocumentationContact

How to comment the sourcecode


Support > AS2Doc Tags



AS2Doc parses special tags when they are embedded within a comment.
These doc tags enable you to autogenerate a complete, well-formatted API from your source code.

They start with an "at" sign (@) and are case-sensitive -- they must be typed with the uppercase and lowercase letters as shown.

A tag must start at the beginning of a line (after any leading spaces and an optional asterisk) or it is treated as normal text.

By convention, tags with the same name are grouped together.
For example, put all @see tags together.

See a fully documented example source file using all tags and features. (Resulting HTML Output)




Overview:

  1. @author
    Defines Author of commented source.
  2. @deprecated
    Marks deprecated API elements
  3. @description
    Long description of the source element.
  4. {@docRoot}
    Relative path to root directory from any generated document.
  5. @exclude
    Code should be excluded from the documentation.
  6. @ignore
    Ignore specific embedded comment parts.
  7. {@include}
    Include external file into comment context.
  8. {@link}
    Inserts an in-line link within a comment.
  9. @param
    Method parameter description.
  10. @return
    Describes the return value of a method.
  11. @see
    Adds a "See Also" heading with a link or text entry that points to reference.
  12. @since
    Mark code which exists since a specific API version.
  13. @usage
    Supply information how to use the following source part.
  14. @version
    Sets version information



@author name-text
Wednesday, March 10, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
 * @author Mr. Pro Grammer
 */
Description:
Adds an "Author" entry with the specified name-text to the generated docs when the -author option is used. A doc comment may contain multiple @author tags. You can specify one name per @author tag or multiple names per tag. In the former case, the Javadoc tool inserts a comma (,) and space between names. In the latter case, the entire text is simply copied to the generated document without being parsed. Therefore, you can use multiple names per line if you want a localized name separator other than comma.

TopBack to top.



@deprecated deprecated-text
Wednesday, November 3, 2004

Since: 1.0.5
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
 * @deprecated Since Flash 6, see {@link #bProperty}
 */
Description:
Adds a comment indicating that this API should no longer be used (even though it may continue to work). The deprecated-text is moved ahead of the main description, summary pages and index, placing it in italics and preceding it with a bold warning: "Deprecated".

TopBack to top.



@description text
Thursday, March 25, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* @description 	This is the main description of the
*		source part following this comment
*		directly. It is detailed and includes
*		<b>HTML</b> or other meta characters.
*/
Description:
Adds a "description" part to the documentation enabling more detailed explaination of the following source part. The text can span multiple lines.

TopBack to top.



{@docRoot }
Saturday, August 7, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* The root of this documentation file is: {@docRoot}
*
* <img src="{@docRoot}as2doc.png">
*/

<img src="{@docRoot}as2doc.png">

would resolve to:

<img src="../../as2doc.png">  for mc/core/Scrollview.as
Description:
Represents the relative path to the generated document's (destination) root directory from any generated page. It is useful when you want to include a file, such as a copyright page or company logo, that you want to reference from all generated pages.

TopBack to top.



@exclude
Thursday, March 25, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* ...
*
* @exclude
*/
Description:
Any comment including this tag will make the following code part not appear in the documentation. This is useful for internal methods still needing a documentation. You can set a filter upon the @exclude tag which ignores this tag in order to inverse the effect and also generate these code parts marked to be excluded.

TopBack to top.



@ignore
Thursday, March 25, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* All text preceeding the tag will be ignored.
* It is usefull to include notes, license information, copyright information,
* file related descriptions and other text not needed for the documentation.
*
* @ignore
*
* This will be a short description.
*
* @description	This is a long description.
*/
Description:
All text since the start of a comment up to the beginning of the tag will be ignored and not used for the documentation. This also clears any prior set tags in the comment and their values.

TopBack to top.



{@include "filename"}
Tuesday, February 15, 2005

Since: 1.1.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* Usage of the include inline tag in order to maintain an external example.
* @example		<pre>{@include "examples/someexample.as"}</pre>
*/
Description:
The tag includes the file specified with filename into the context of the comment. The contents of this file are parsed for further inline-tags as well. The filename?s location is relative to the sourcefile containing the inline-tag.

TopBack to top.



{@link package.class#member label}
Saturday, August 7, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* Use the {@link mc.core.View#draw} method.
*/

Results: (if issued from another class within same package)

Use the View.draw method.
Description:
Inserts an in-line link with visible text label that points to the documentation for the specified package, class or member name of a referenced class.

This tag is very simliar to @see -- both require the same references and accept exactly the same syntax for package.class#member and label. The main difference is that {@link} generates an in-line link rather than placing the link in the "See Also" section.
Also, the {@link} tag begins and ends with curly braces to separate it from the rest of the in-line text.


TopBack to top.



@param [name] description
Sunday, August 22, 2004

Since: 1.0.0
Scope: Class/Interface Methods
Usage:
/**
 * @param p1 The first parameter
 * @param p2 The second method parameter
 */

If name is omitted, the order of the @param 
tags decides association with the method parameter.

/**
 * @param The first parameter
 * ...
 * @param The second method parameter
 */
Description:
Adds a parameter to the "Parameters" section. The description may be continued on the next line. This tag is valid only in a doc comment for a method or constructor.
The type of the parameter is automaticly added.
Multiple tag order has to reflect the order of the parameters of the documenting method if the name from the signature of the method is omitted.


TopBack to top.



@return description
Thursday, March 25, 2004

Since: 1.0.0
Scope: Class/Interface Methods
Usage:
/**
* ...
* @return Last known position
*/
Description:
The text should describe the returned value.

TopBack to top.



@see reference
Saturday, August 7, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* @see "string"
* @see <a href="URL#value">URL Label</a>
* @see package.class#member
*/

Results in:

"string"
URL Label
package.class.member
Description:
Adds a "See Also" heading with a link or text entry that points to reference. A doc comment may contain any number of @see tags, which are all grouped under the same heading.
The @see tag has three variations; the third form (package.class#member label) is the most common For inserting an in-line link within a sentence to a package, class or member, see {@link}.


TopBack to top.



@since text
Thursday, March 25, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* @since	Test API 1.0
*/
Description:
This tag means that this change or feature has existed since the software release specified by the "text".

TopBack to top.



@usage text
Thursday, March 25, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
* @usage     <pre>myTest = new CTest(p1[, p2]);</pre>
*/
Description:
Adds a "usage" part to the documentation describing a short information how to use the following source code element.

TopBack to top.



@version version-text
Wednesday, March 10, 2004

Since: 1.0.0
Scope: All (File, Class/Interface, Attributes, Methods)
Usage:
/**
 * @version 0.8.4 RC1
 */
Description:
Adds a "Version" subheading with the specified version-text to the generated docs when the -version option is used. This tag is intended to hold the current version number of the software that this code is part of (as opposed to @since, which holds the version number where this code was introduced). The version-text has no special internal structure.

TopBack to top.



© 2003-2012 Mirell Development. All rights reserved. | Legal Notice