ASP Documentor Reference
The following things are important in order to create a documentation for your ASP (VBScript) code:
- Works only for ASP written with VBScript
-
Documents only classes and its public members
- Only one class per .asp file
- Comments recognized by documentor must start with
''
- Documentor keywords always start with
@ and end with :
- Types are surrounded by
[] e.g. [bool]
- Documentor can be found in the ajaxed console.
http://yourhost.com/ajaxed/console/ (ajaxed must be installed)
- It's always good to take a look at the ajaxed code to see how the ajaxed team is creating the documentation.
Examples of proper comments which will be recognized by documentor:
public function getMe()
end function
public property get color
end property
Keywords for class documentation
@CLASSTITLE |
Title of the class |
@CREATOR |
Name of the class creator. Also email can be added. |
@CREATEDON |
Date and time of class creation (format up to you) |
@CDESCRIPTION |
Full class description |
@STATICNAME |
Name of the variable which holds already an instance of the class.
This simulates the OO concept of static classes like e.g. StringOperations which is available
with the staticname str.
|
@POSTFIX |
Postfix for SmartSense (intellissense support) plugin in Macromedia Homesite |
@VERSION |
Class version. e.g. 1.0 |
@COMPATIBLE |
What browsers are supported by this class. Useful if the class is a control which renders HTML |
@REQUIRES |
List of other classes which are required. Seperated with "," |
@FRIENDOF |
Name of the class this class is friend of.
Useful if your component consists of more classes and they are always used as a bundle.
e.g. Dropdown and DropdownItem. Both are always used togehter and
DropdownItem is loaded automatically with Droddown. Thus DropdownItem
is a friend of Dropdown.
|
Example of a proper class documentation:
Keywords for method documentation
@SDESCRIPTION |
A one sentence description. |
@DESCRIPTION |
The full description of the method. Includes all the details which short description does not. |
@ALIAS |
Alias names for the same method (comma separated). |
@PARAM |
Documentation of a method's parameter.
The parameter should contain one (or more) type definition(s).
byRef and byVal are recognized as well.
- If a parameter cannot be found in the method signature and there is a parameter called
option then its assumed as documentation of an option
|
@RETURN |
Description about the return value (if function) including its type(s) |
Example of a proper method documentation:
public function getAllBy(creationDate, role)
end function
Property/public member variables documentation
Properties (public property) and public member variables are documented
immediately after their definition with a description and it's type.
Example of a proper property documentation:
public property get name
end property
public property set name(val)
end property
public property set role
end property
Example of a proper public member documentation:
public ID
public name
Other documentor keywords (Markers)
STATIC! |
Can be used within the description of methods to mark them as static methods (callable without an instance). |
OBSOLETE! |
Can bee used within the description of methods, properties or public member variables to indicate that a member is obsolete. |
Examples:
public ID
public function getBy(id)
end function
public function getByID(id)
end function
Initializations
Initializations document the default values of class properties. Those values
are assigned within the constructor using the lib.init method. This method
tries to get the value from a given variable and if not possible it takes a fallback
value (default value). Those default values are documented as well because
its a core concept of the ajaxed library which is used for the config vars of
/ajaxedConfig/config.asp. With this it's possible to see the name of the
config var and its default value.
Within custom applications it's possible to create own config variables which are
initialized with the same concept.
Example:
class Document
public location
public sub class_initialize()
location = lib.init(DOCUMENT_LOCATION, "/documents/")
end sub
end class
Parsing & other important things
You should know the following things about the parsing of documentation:
Michal Gabrukiewicz, David Rankin. updated July, 2008
'' @RETURN: [string] returns my name