Jump to content

Natural Docs: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Dayyan (talk | contribs)
Violation of Key Policy 4.
Line 7: Line 7:
==Example==
==Example==


This is an example of the documentation style. See [http://www.naturaldocs.org/documenting.html the full syntax reference] for more details.
This is an example of the documentation style.


/*
/*
Line 27: Line 27:
int Multiply (int x, int y)
int Multiply (int x, int y)
{ return x * y; };
{ return x * y; };

In comparison with [[Javadoc]], the same thing would be documented as the following in source code. Note how the Javadoc tags make the source code harder to read than the above example.

/**
* Multiplies two integers.
*
* @param x The first integer.
* @param y The second integer.
* @return The two integers multiplied together.
* @see Divide
*/
int Multiply (int x, int y)
{ return x * y; };

You can also see an [http://www.naturaldocs.org/documentation/html/ example of the generated documentation.]


==See also==
==See also==

Revision as of 16:08, 25 October 2006

Natural Docs is a multi-language documentation generator. It is written in Perl and is available as free software under the terms of the GNU General Public License. It attempts to keep the comments written in source code just as readable as the generated documentation. It is written and maintained by Greg Valure.

Theoretically, it can generate documentation from any language that can support comments, or from plain text files. When executed, it can automatically document functions, variables, classes, and inheritance from ActionScript 2.0, C#, and Perl regardless of existing documentation in the source code. In all other languages, these need to be explicitly documented for them to be generated. It can generate documentation in HTML, either with frames or without.

Unlike Javadoc, it is not considered an industry standard for documenting in any language, although Javadoc compatibility is being developed for certain languages.[1] It is used by some hobbyists and companies, such as Iron Realms Entertainment.[2] It has gained popularity amongst ActionScript 2.0 developers because no other free documentation generator exists that fully supports ActionScript 2.0 and because it generates higher-quality output than similar generators that partially support the language, such as ROBODoc.

Example

This is an example of the documentation style.

/*
 * Function: Multiply
 * 
 * Multiplies two integers.
 *
 * Parameters:
 *    x - The first integer.
 *    y - The second integer.
 *
 * Returns:
 *    The two integers multiplied together.
 *
 * See Also:
 *    <Divide>
 */

int Multiply (int x, int y)
   {  return x * y;  };

See also

Notes and references

  1. ^ Javadoc Support on NaturalDocs.org
  2. ^ Rapture by Iron Realms Entertainment and generated documentation using Natural Docs.

Further reading