PEDN> Main Web>NPL > DeveloperDoc>DocumentingNote (2008-03-01, LiXizhi) Change language en zh-cn? EditAttach

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:


Description of this functions purpose<br />@param parameter_name description<br />@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
*/

For NPL code:

--[[
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	

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 - 17:52:18 - LiXizhi
 

ParaEngine Developer Network

This site is powered by the TWiki collaboration platformCopyright © 2004-2009 ParaEngine Corporation
Ideas, requests, problems regarding ParaEngine platform Send feedback