Gustavo Carreno
Gustavo Carreno

Reputation: 9759

Most common docblock for Delphi and/or FreePascal code

I'm quite familiar with PHP dockblocks since it's been my job for the last 15+ years.

/**
  * Description
  *
  * @tag bla bla
  * @tag more bla bla
  */

What I'm trying to understand is if there is a standard like that for Delphi and/or FreePascal.

From my analysis on an awful lot of code I never seen any, but I could be dead wrong.

Upvotes: 8

Views: 3447

Answers (6)

user81864
user81864

Reputation: 563

Delphi documentation tools

Using the XMLDoc tool for API documentation and HelpInsight with Delphi 2005   http://edn.embarcadero.com/article/32770

XML Documentation in Delphi 2006   http://tondrej.blogspot.com/2006/03/xml-documentation-in-delphi-2006.html

DelphiCodeToDoc   http://dephicodetodoc.sourceforge.net/

Doc-O-Matic   http://www.doc-o-matic.com/examplesourcecode.html

PasDoc   http://pasdoc.sipsolutions.net/

Pascal Browser   http://www.peganza.com/

Doxygen   http://www.doxygen.nl/

Pas2Dox   http://sourceforge.net/projects/pas2dox/

JADD - Just Another DelphiDoc   http://delphidoc.sourceforge.net/

Stackoverflow discussion

Is there a Delphi code documentor that supports current Delphi syntax?   https://stackoverflow.com/questions/673248/is-there-a-delphi-code-documentor-that-supports-current-delphi-syntax

Code documentation for delphi similar to javadoc or c# xml doc   Code documentation for delphi similar to javadoc or c# xml doc

Documenting Delphi   https://stackoverflow.com/questions/33336/documenting-delphi

Upvotes: 15

1800 INFORMATION
1800 INFORMATION

Reputation: 135245

It looks like doxygen has a tool which can be used in conjunction to document Pascal and Delphi code. Maybe that will help you.

Upvotes: 1

onnodb
onnodb

Reputation: 5261

On a project I'm currently working on, we're using DelphiCodeToDoc, which works reasonably well. Its syntax looks like this:

type
  {* This is an example class }
  TMyClass = class
  private
  protected
  public
    {* Does some twiddling with AParam, and returns the result as String
       @param AParam Input value
       @return AParam incremented by 2, as String
       @throws Exception 'Boo' if it's full moon }
    function MyFunction(AParam: Integer): String;
  end;

Upvotes: 1

Marco van de Voort
Marco van de Voort

Reputation:

I prefer docs outside of the source (it always gets messy), and use the excellent fpdoc that comes with FPC. (FPC's own docs are written in it).

Upvotes: 1

dummzeuch
dummzeuch

Reputation: 11217

There are several standards, usually depending on the documentation tool being used. We use PasDoc, so we adhere mostly to its format http://pasdoc.sipsolutions.net/ which is based on JavaDoc.

Alternatively, there is XMLDoc as gabr pointed out and there are quite a few other tools, most having similar syntax with subtle differences.

Upvotes: 0

gabr
gabr

Reputation: 26830

Latest Delphis support parsing of XML documentation. They also use this information in hints (for example if you move the mouse cursor over a method name).

I'm using this template for method documentation:

///<summary></summary>
///<param name=''></param>
///<returns></returns>
///<exception cref=""></exception>
///<since>2009-04-15</since>

Upvotes: 7

Related Questions