How to Write Documentation for NPL and ParaEngine

NPL and ParaEngine uses Doxygen to document the APIs and global variables in the code. This will explain the basics of how to document using Doxygen.

Brief Description

To start a documentation block, use /**
To end a documentation block, use */

In the middle of the block, there are multiple tags we can use:

For Cpp code: %CODE{"cpp"}%

Description of this functions purpose
@param parameter_name description
@return description

/**
* return the final element of the pathname
* @param pathname The path to get the final element of
* @return the final element of the path
* @tip Examples: */

At the top of the header file, always include:

/**
* @package Name of library header
*/

%ENDCODE%

For NPL code: %CODE{"lua"}% --[[ Title: math lib funcions Author(s): LiXizhi Date: 2007/10/18 Desc: Use Lib:


NPL.load("(gl)script/ide/mathlib.lua");
]] if(not mathlib) then mathlib={}; end

-- Conversion Quaternion to Euler -- @param q1: {x,y,z,w} -- @return: heading, attitude, bank -- @note: code converted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm function mathlib.QuatToEuler(q1)

end

%ENDCODE%

Doxygen uses a new HTML file for each package. The HTML files are named {Name_of_library_header}.html, so try to be concise with your names.

For a further discussion of the possibilities please refer to the Doxygen site.

Topic revision: r1 - 2008-03-01 - LiXizhi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback