RellDoc: Documentation Comments for Rell
RellDoc is the documentation comment format for the Rell programming language. It provides a standardized way to document your code, making it more maintainable and easier to understand.
Generating Documentation
RellDoc comments is also processed by documentation generation tools to create comprehensive API documentation for your Rell codebase. If you want to read more on the topic of documentation generation, take a look at: Generating Documentation Sites
RellDoc Syntax
RellDoc comments begin with /**
and end with */
. The content of the comment is written between these delimiters,
with each line typically starting with an asterisk (*
).
/**
* This is a RellDoc comment.
* It spans multiple lines.
*/
Supported Tags
RellDoc supports the following tags:
@param
Documents a function, operation, or query parameter.
Syntax: @param parameterName description
Example:
/**
* @param username The username to authenticate
*/
@return
Documents the return value of a function or query.
Syntax: @return description
Example:
/**
* @return Boolean indicating whether authentication was successful
*/
@throws
Documents an exception that might be thrown by a function or query.
Syntax: @throws exception description
Example:
/**
* @throws UserNotFound When the username doesn't exist
*/
@see
Adds a hint to where to find more information.
Syntax: @see reference description
Example:
/**
* @see user_validation For additional validation rules
*/
@since
Specifies the version in which the documented element was introduced.
Syntax: @since version
Example:
/**
* @since 1.10.0
*/
@author
Specifies the author of the element being documented.
Syntax: @author name
Example:
/**
* @author Jane Doe
*/
Complete Example
/**
* Authenticates a user in the system.
*
* @param username The username to authenticate
* @return Boolean indicating whether authentication was successful
* @throws UserNotFound When the username doesn't exist
* @since 1.10.0
* @see user_validation For additional validation rules
* @author Jane Doe
*/
function authenticate_user(username: text): boolean {
require(username != "not_found", "UserNotFound: Username not found");
return true;
}